diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index bc832187e7d1c1dfabcbf7f3f4ab3ae2f1bc026a..9c9eeea01dff3442cdadc89373661cb2e1be5799 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -1959,6 +1959,16 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon, goto cleanup; } + if (strstr(reply, "Could not open")) { + size_t len = strlen(reply); + if (reply[len - 1] == '\n') + reply[len - 1] = '\0'; + + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + reply); + goto cleanup; + } + ret = 0; cleanup: