From: Jie Wang Date: Fri, 31 May 2019 07:33:31 +0000 (+0800) Subject: qemu: Try harder to remove pr-helper object and kill pr-helper process X-Git-Tag: v5.5.0-rc1~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a232286b9d8c19ad62cb93c19e4651894447743;p=thirdparty%2Flibvirt.git qemu: Try harder to remove pr-helper object and kill pr-helper process If libvirt receives DISCONNECTED event and prDaemonRunning is set to false, and qemuDomainRemoveDiskDevice() is performing in the meantime, then qemuDomainRemoveDiskDevice() will fail to remove pr-helper object because prDaemonRunning is false. But removing that check from qemuHotplugRemoveManagedPR() is not enough, because after removing the object through monitor the qemuProcessKillManagedPRDaemon() is called which contains the same check. Thus the pr-helper process might be left behind. Signed-off-by: Jie Wang Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 59ff88565d..efda539208 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -397,8 +397,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver, virErrorPtr orig_err; int ret = -1; - if (!priv->prDaemonRunning || - virDomainDefHasManagedPR(vm->def)) + if (virDomainDefHasManagedPR(vm->def)) return 0; virErrorPreserveLast(&orig_err); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f114611e02..1626796c19 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2749,9 +2749,6 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm) virErrorPtr orig_err; char *pidfile; - if (!priv->prDaemonRunning) - return; - if (!(pidfile = qemuProcessBuildPRHelperPidfilePath(vm))) { VIR_WARN("Unable to construct pr-helper pidfile path"); return;