mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fix check for errors in device_add command in QEMU text monitor
Any output at all from device_add indicates an error in the command execution. Thus it needs to check for reply != "" * src/qemu/qemu_monitor_text.c: Fix reply check for errors to treat any output as an error
This commit is contained in:
parent
345ff369e5
commit
c833efd35b
@ -2319,11 +2319,11 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the command failed qemu prints:
|
/* If the command succeeds, no output is sent. So
|
||||||
* Could not add ... */
|
* any non-empty string shows an error */
|
||||||
if (strstr(reply, "Could not add ")) {
|
if (STRNEQ(reply, "")) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("adding %s device failed"), devicestr);
|
_("adding %s device failed: %s"), devicestr, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user