]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Don't explicitly remove pidfile after virPidFileForceCleanupPath()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Feb 2020 10:46:24 +0000 (11:46 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Feb 2020 11:57:19 +0000 (12:57 +0100)
In two places where virPidFileForceCleanupPath() is called, we
try to unlink() the pidfile again. This is needless because
virPidFileForceCleanupPath() has done just that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c
src/qemu/qemu_vhost_user_gpu.c

index bf987a3bc30c0b047a594627e673759c0e747d68..8c1ed766779c90a37211f96bc5d36dd2fad93d08 100644 (file)
@@ -2802,14 +2802,7 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm)
     if (virPidFileForceCleanupPath(pidfile) < 0) {
         VIR_WARN("Unable to kill pr-helper process");
     } else {
-        if (unlink(pidfile) < 0 &&
-            errno != ENOENT) {
-            virReportSystemError(errno,
-                                 _("Unable to remove stale pidfile %s"),
-                                 pidfile);
-        } else {
-            priv->prDaemonRunning = false;
-        }
+        priv->prDaemonRunning = false;
     }
     virErrorRestore(&orig_err);
 }
index 51244f9b35c0b08dd9baa989d3d3aa17f4f0d26e..ae1f530338090893e9986b0ce0ef0f75f6d24eb5 100644 (file)
@@ -223,16 +223,8 @@ void qemuExtVhostUserGPUStop(virQEMUDriverPtr driver,
     }
 
     virErrorPreserveLast(&orig_err);
-    if (virPidFileForceCleanupPath(pidfile) < 0) {
+    if (virPidFileForceCleanupPath(pidfile) < 0)
         VIR_WARN("Unable to kill vhost-user-gpu process");
-    } else {
-        if (unlink(pidfile) < 0 &&
-            errno != ENOENT) {
-            virReportSystemError(errno,
-                                 _("Unable to remove stale pidfile %s"),
-                                 pidfile);
-        }
-    }
     virErrorRestore(&orig_err);
 }