mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-08 14:29:56 +00:00
Fix check of virKillProcess return status
The error code for virKillProcess is returned in the errno variable not the return value. THis mistake caused the logs to be filled with errors when shutting down QEMU processes * src/qemu/qemu_process.c: Fix process kill check.
This commit is contained in:
parent
eb2664cbe6
commit
a018c0b910
@ -2518,7 +2518,6 @@ cleanup:
|
||||
void qemuProcessKill(virDomainObjPtr vm)
|
||||
{
|
||||
int i;
|
||||
int rc;
|
||||
VIR_DEBUG("vm=%s pid=%d", vm->def->name, vm->pid);
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
@ -2540,9 +2539,8 @@ void qemuProcessKill(virDomainObjPtr vm)
|
||||
else
|
||||
signum = 0; /* Just check for existence */
|
||||
|
||||
rc = virKillProcess(vm->pid, signum);
|
||||
if (rc < 0) {
|
||||
if (rc != -ESRCH) {
|
||||
if (virKillProcess(vm->pid, signum) < 0) {
|
||||
if (errno != ESRCH) {
|
||||
char ebuf[1024];
|
||||
VIR_WARN("Failed to kill process %d %s",
|
||||
vm->pid, virStrerror(errno, ebuf, sizeof ebuf));
|
||||
|
Loading…
Reference in New Issue
Block a user