mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
qemu_process: Be nicer to killing QEMU when probing caps
The qemuProcessQMPStop() function is intended to kill this dummy QEMU process we started only for querying capabilities. Nevertheless, it may be not plain QEMU binary we executed, but in fact it may be a memcheck tool (e.g. valgrind) that executes QEMU later. By switching to virProcessKillPainfully() we allow this wrapper tool to exit gracefully. Another up side is that virProcessKillPainfully() reports an error so no need for us to VIR_ERROR() ourselves. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
e4327557a4
commit
db7b0b12b7
@ -9131,11 +9131,8 @@ qemuProcessQMPStop(qemuProcessQMP *proc)
|
|||||||
|
|
||||||
if (proc->pid != 0) {
|
if (proc->pid != 0) {
|
||||||
VIR_DEBUG("Killing QMP caps process %lld", (long long)proc->pid);
|
VIR_DEBUG("Killing QMP caps process %lld", (long long)proc->pid);
|
||||||
if (virProcessKill(proc->pid, SIGKILL) < 0 && errno != ESRCH)
|
virProcessKillPainfully(proc->pid, true);
|
||||||
VIR_ERROR(_("Failed to kill process %lld: %s"),
|
virResetLastError();
|
||||||
(long long)proc->pid,
|
|
||||||
g_strerror(errno));
|
|
||||||
|
|
||||||
proc->pid = 0;
|
proc->pid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user