diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 4b1e2ecd8dcf606209308e965c62038172ef6255..c0ebe5f369ccd8c11b30c8bc962934b1760970ac 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -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; }