提交 c833efd3 编写于 作者: D Daniel P. Berrange

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
上级 345ff369
......@@ -2319,11 +2319,11 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
goto cleanup;
}
/* If the command failed qemu prints:
* Could not add ... */
if (strstr(reply, "Could not add ")) {
/* If the command succeeds, no output is sent. So
* any non-empty string shows an error */
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("adding %s device failed"), devicestr);
_("adding %s device failed: %s"), devicestr, reply);
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册