From 74ec3f4d7d3f43249f131be9fb6c417289804955 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 20 Feb 2020 11:46:24 +0100 Subject: [PATCH] qemu: Don't explicitly remove pidfile after virPidFileForceCleanupPath() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- src/qemu/qemu_process.c | 9 +-------- src/qemu/qemu_vhost_user_gpu.c | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bf987a3bc3..8c1ed76677 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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); } diff --git a/src/qemu/qemu_vhost_user_gpu.c b/src/qemu/qemu_vhost_user_gpu.c index 51244f9b35..ae1f530338 100644 --- a/src/qemu/qemu_vhost_user_gpu.c +++ b/src/qemu/qemu_vhost_user_gpu.c @@ -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); }