mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
fix the check of the output of monitor command 'device_add'
Hotpluging host usb device by text mode will fail, because the monitor command 'device_add' outputs 'husb: using...' if it succeeds, but we think the command should not output anything. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
This commit is contained in:
parent
72d4ff5b7c
commit
c4dae2d9a8
@ -2283,7 +2283,15 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* If the command succeeds, no output is sent. So
|
||||
/* If the host device is hotpluged first time, qemu will output
|
||||
* husb: using %s file-system with %s if the command succeeds.
|
||||
*/
|
||||
if (STRPREFIX(reply, "husb: using")) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Otherwise, if the command succeeds, no output is sent. So
|
||||
* any non-empty string shows an error */
|
||||
if (STRNEQ(reply, "")) {
|
||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||
|
Loading…
x
Reference in New Issue
Block a user