[libvirt] [PATCH v6] util: Set SIGPIPE to a no-op handler in virFork

2019-11-07 Thread Wang Yechao
reset to SIG_DFL when execve() runs. Now we can delete sigaction() call entirely in virExec(). Signed-off-by: Wang Yechao --- v3 patch: https://www.redhat.com/archives/libvir-list/2019-October/msg00934.html Changes in v4: - don't block SIGPIPE, ignore it when invoke VIR_FORCE_CLOSE

[libvirt] [PATCH v5] util: Set SIGPIPE to a no-op handler in virFork

2019-10-18 Thread Wang Yechao
SIGPIPE ignored before running hooks in virExec. At last, set SIGPIPE to defaults before execve. Signed-off-by: Wang Yechao --- v3 patch: https://www.redhat.com/archives/libvir-list/2019-October/msg00934.html Changes in v4: - don't block SIGPIPE, ignore it when invoke VIR_FORCE_CLOSE

[libvirt] [PATCH v4] util: Ignore SIGPIPE before write logs to stderr in child process

2019-10-16 Thread Wang Yechao
to SIG_DFL after that. In virProcessRunInFork(), just set SIGPIPE to ignored. Signed-off-by: Wang Yechao --- v1 patch: https://www.redhat.com/archives/libvir-list/2019-October/msg00720.html Changes in v2: - use pthread_sigmask to block SIGPIPE Changes in v3: - pass SIG_UNBLOCK(not SIG_SETMASK

[libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-15 Thread Wang Yechao
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So block SIGPIPE in virFork, and unblock it before execve. Signed-off-by: Wang Yechao --- v1 patch

[libvirt] [PATCH v2] util: Block SIGPIPE until execve in child process

2019-10-14 Thread Wang Yechao
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So block SIGPIPE in virFork, and unblock it before execve. Signed-off-by: Wang Yechao --- v1 patch

[libvirt] [PATCH] util: ignore SIGPIPE when writing to stderr/stdout

2019-10-14 Thread Wang Yechao
oom killer kill it. ... Signed-off-by: Wang Yechao --- src/util/virlog.c | 8 1 file changed, 8 insertions(+) diff --git a/src/util/virlog.c b/src/util/virlog.c index 4c76fbc..127e121 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -39,6 +39,7 @@ # include #endif #include

[libvirt] [PATCH] util: change the return value of virCgroupRemove if failed

2019-07-18 Thread Wang Yechao
VIR_WARN("Failed to remove cgroup for %s", vm->def->name); } The return value of qemuRemoveCgroup will never be equal to "-EBUSY", so change the return value of virCgroupRemove if failed. Signed-off-by: Wang Yechao --- src/util/vircgroup.c |

[libvirt] [PATCH] qemu: Update a domain's persistent definition file if it's defined

2018-12-20 Thread Wang Yechao
From: Li XueLei During making disk snapshot in an active domain, sometimes we should update the domain's persistent definition.We must check if the domain is defined, before we update the persistent definition file. First,we create a vm.Then,define the vm and undefine the vm.Last create a

[libvirt] [PATCH v2] qemu: Assign device address before qemuDomainSupportsNicdev

2018-12-17 Thread Wang Yechao
qemuDomainSupportsNicdev will check the device address type on aarch64. If it is invoked before device address assigned, hotadd vhostuser interface with no address specified will get error. Let qemuDomainEnsurePCIAddress run before qemuDomainSupportsNicdev. Signed-off-by: Wang Yechao --- v1

[libvirt] [PATCH] qemu: Add default address type for vhost-user interface on aarch64

2018-12-14 Thread Wang Yechao
in qemuDomainAttachNetDevice. Using pci as the default address type, and assigns pci address later in qemuDomainEnsurePCIAddress. Signed-off-by: Wang Yechao --- src/qemu/qemu_hotplug.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 68d021a..c1464a9

[libvirt] [PATCH] qemu:address:Fix segfault in qemuDomainPrimeVirtioDeviceAddresses

2018-11-08 Thread Wang Yechao
On aarch64, lauch vm with the follow configuration: libvirtd will crash when access the net->model. Signed-off-by: Wang Yechao --- src/qemu/qemu_domain_address.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain_address.c b/src/q

[libvirt] [PATCH v3] qemu: agent: Avoid agentError when closing the QEMU agent

2018-10-11 Thread Wang Yechao
The commit 89563efc0209b854d2b2e554423423d7602acdbd fix the monitor error when closing the QEMU monitor. The QEMU agent has a problem similar to QEMU monitor. So fix the QEMU agent with the same method. Signed-off-by: Wang Yechao --- Changes in v3: - change the commit messages --- src/qemu

[libvirt] [PATCH v2] qemu: agent: Avoid agentError when closing the QEMU agent

2018-09-28 Thread Wang Yechao
est-agent process in guest. Silently ignore the case where mon->fd is -1, likewise for mon->watch being zero. Signed-off-by: Wang Yechao --- v1 patch: https://www.redhat.com/archives/libvir-list/2018-September/msg01382.html Changes in v2: - do not set agentError, let agent state as disco

[libvirt] [PATCH] qemu: agent: Reset agentError when qemuConnectAgent success

2018-09-27 Thread Wang Yechao
tAgent return success later. This is accidently occurs when hot-add-vcpu in windows2012. virsh setvcpus ... virsh qemu-agent-command $vm '{"execute":"guest-get-vcpus"}' Reset the priv->agentError to 'false' when qemuConnectAgent sucess to fix this problem. Signed-off-by: Wang

[libvirt] [PATCH v4 0/4] qemu: Fix deadlock if create qemuProcessReconnect thread failed

2018-09-20 Thread Wang Yechao
v3 patch: https://www.redhat.com/archives/libvir-list/2018-September/msg00950.html --- Changes in v4: - Split up v3 into four parts Wang Yechao (4): qemu: Split up qemuDomainRemoveInactive qemu: Create a qemuDomainRemoveInactiveLocked qemu: Create a qemuDomainRemoveInactiveJobLocked

[libvirt] [PATCH v4 4/4] qemu: Fix deadlock if create qemuProcessReconnect thread failed

2018-09-20 Thread Wang Yechao
qemuProcessReconnectHelper has hold lock on doms, if create qemuProcessReconnect thread failed, calls qemuDomainRemoveInactiveJob will lead to deadlock. Modify qemuProcessReconnectHelper to call qemuDomainRemoveInactiveJobLocked. Signed-off-by: Wang Yechao --- src/qemu/qemu_process.c | 2 +- 1

[libvirt] [PATCH v4 3/4] qemu: Create a qemuDomainRemoveInactiveJobLocked

2018-09-20 Thread Wang Yechao
Create a qemuDomainRemoveInactiveJobLocked which copies qemuDomainRemoveInactiveJob except of course calling virDomainObjListRemoveLocked. Signed-off-by: Wang Yechao --- src/qemu/qemu_domain.c | 21 + src/qemu/qemu_domain.h | 3 +++ 2 files changed, 24 insertions(+) diff

[libvirt] [PATCH v4 1/4] qemu: Split up qemuDomainRemoveInactive

2018-09-20 Thread Wang Yechao
Split up qemuDomainRemoveInactive into qemuDomainRemoveInactiveCommon and virDomainObjListRemove Signed-off-by: Wang Yechao --- src/qemu/qemu_domain.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu

[libvirt] [PATCH v4 2/4] qemu: Create a qemuDomainRemoveInactiveLocked

2018-09-20 Thread Wang Yechao
Create a qemuDomainRemoveInactiveLocked which is a copy of qemuDomainRemoveInactive except that instead of calling virDomainObjListRemove it calls virDomainObjListRemoveLocked. Signed-off-by: Wang Yechao --- src/qemu/qemu_domain.c | 22 ++ 1 file changed, 22 insertions

[libvirt] [PATCH v3] qemu: fix deadlock if create qemuProcessReconnect thread failed

2018-09-19 Thread Wang Yechao
qemuProcessReconnectHelper has hold lock on doms, if create qemuProcessReconnect thread failed, calls qemuDomainRemoveInactiveJob will lead to deadlock. Add a qemuDomainRemoveInactiveJobLocked, modify qemuProcessReconnectHelper to call it. Signed-off-by: Wang Yechao --- v2 patch: https

[libvirt] [PATCH v2] numa: fix unsafe access to numa_nodes_ptr

2018-09-13 Thread Wang Yechao
(data=) at util/virthread.c:206 7 0x7f40e214ee25 in start_thread () from /lib64/libpthread.so.0 8 0x7f40e1e7c36d in clone () from /lib64/libc.so.6 Signed-off-by: Wang Yechao --- src/util/virnuma.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virnuma.c

[libvirt] [PATCH v2] qemu: fix deadlock if create qemuProcessReconnect thread failed

2018-09-13 Thread Wang Yechao
qemuProcessReconnectHelper has hold the doms lock, if create qemuProcessReconnect thread failed, it will get the doms lock again to remove the dom from doms list. add obj->inReconnetCtx flag to avoid deadlock. Signed-off-by: Wang Yechao --- src/conf/domain_conf.h | 1 + src/c

[libvirt] [PATCH v2] nwfilter: fix deadlock when nwfilter reload

2018-09-13 Thread Wang Yechao
nto thread to fix this problem. Signed-off-by: Wang Yechao Reviewed-by: Wang Yi --- src/nwfilter/nwfilter_driver.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 1ee5162..ab85072 100644 --- a/sr

[libvirt] [PATCH] numa: fix unsafe access to numa_nodes_ptr

2018-09-12 Thread Wang Yechao
(data=) at util/virthread.c:206 7 0x7f40e214ee25 in start_thread () from /lib64/libpthread.so.0 8 0x7f40e1e7c36d in clone () from /lib64/libc.so.6 Signed-off-by: Wang Yechao --- src/util/virnuma.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virnuma.c

[libvirt] [PATCH] qemu: fix deadlock if create qemuProcessReconnect thread failed

2018-09-11 Thread Wang Yechao
qemuProcessReconnectHelper has hold the doms lock, if create qemuProcessReconnect thread failed, it will get the doms lock again to remove the dom from doms list. add obj->inReconnetCtx flag to avoid deadlock. Signed-off-by: Wang Yechao --- src/conf/domain_conf.h | 1 + src/c

[libvirt] [PATCH] nwfilter:fix deadlock when nwfilter reload

2018-09-11 Thread Wang Yechao
nto thread to fix this problem. Signed-off-by: Wang Yechao Reviewed-by: Yi Wang --- src/nwfilter/nwfilter_driver.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/nwfilter/nwfilter_driver.c diff --git a/src/nwfilter/nwfilter_driver.c b

[libvirt] [PATCH] nwfilter: fix deadlock when nwfilter reload

2018-09-11 Thread Wang Yechao
nto thread to fix this problem. Signed-off-by: Wang Yechao Reviewed-by: Wang Yi --- src/nwfilter/nwfilter_driver.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 1ee5162..8dcc40b 100644 --- a/sr

[libvirt] [PATCH] nwfilter:fix deadlock when nwfilter reload

2018-09-11 Thread Wang Yechao
nto thread to fix this problem. Signed-off-by: Wang Yechao Reviewed-by: Wang Yi --- src/nwfilter/nwfilter_driver.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/nwfilter/nwfilter_driver.c diff --git a/src/nwfilter/nwfilter_driver.c b

[libvirt] [PATCH] nwfilter:fix deadlock when nwfilter reload

2018-09-11 Thread Wang Yechao
nto thread to fix this problem. Signed-off-by: Wang Yechao Reviewed-by: Wang Yi --- src/nwfilter/nwfilter_driver.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/nwfilter/nwfilter_driver.c diff --git a/src/nwfilter/nwfilter_driver.c b

[libvirt] [PATCH] nwfilter:fix deadlock when nwfilter reload

2018-09-11 Thread Wang Yechao
nto thread to fix this problem. Signed-off-by: Wang Yechao Reviewed-by: Wang Yi --- src/nwfilter/nwfilter_driver.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/nwfilter/nwfilter_driver.c diff --git a/src/nwfilter/nwfilter_driver.c b