qemu: Don't explicitly remove pidfile after virPidFileForceCleanupPath()

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>
This commit is contained in:
Michal Privoznik 2020-02-20 11:46:24 +01:00
parent ac21e39faa
commit 74ec3f4d7d
2 changed files with 2 additions and 17 deletions

View 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);
}

View 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);
}