diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index e057bbea506c7ba0dfed52b653bc0e219107d202..99427682e9502a592bccd8201ffc91826b2727a4 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -907,6 +907,13 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon, goto cleanup; } + /* Could not open message indicates bad filename */ + if (strstr(reply, "\nCould not open ")) { + qemuReportError(VIR_ERR_OPERATION_FAILED, + _("could not change media on %s: %s"), devname, reply); + goto cleanup; + } + ret = 0; cleanup: