]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Try harder to remove pr-helper object and kill pr-helper process
authorJie Wang <wangjie88@huawei.com>
Fri, 31 May 2019 07:33:31 +0000 (15:33 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 14 Jun 2019 07:51:10 +0000 (09:51 +0200)
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 <wangjie88@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c

index 59ff88565d89bdce7d33355ca95ec3f63fec1a9e..efda5392087d232f5c93e465abb6d109ef7b867d 100644 (file)
@@ -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);
index f114611e02c474f17538c76e4024ae3cdc881daf..1626796c1928ed5823b1056d9b96419ef0e5ccac 100644 (file)
@@ -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;