diff --git a/ChangeLog b/ChangeLog index 32cdeb9564..ce19e508f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 3 10:42:00 EST 2008 Cole Robinson + + * src/qemu_driver.c: scrape media eject output to determine failure + Wed Sep 3 09:58:00 EST 2008 Cole Robinson * src/domain_conf.c: fix disk device ordering when parsing domain diff --git a/src/qemu_driver.c b/src/qemu_driver.c index f71b6e8569..649a0a5adb 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -2972,6 +2972,19 @@ static int qemudDomainChangeCDROM(virDomainPtr dom, VIR_FREE(cmd); return -1; } + + /* If the command failed qemu prints: + * device not found, device is locked ... + * No message is printed on success it seems */ + DEBUG ("cdrom change reply: %s", reply); + if (strstr(reply, "\ndevice ")) { + qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, + "%s", _("changing cdrom media failed")); + VIR_FREE(reply); + VIR_FREE(cmd); + return -1; + } + VIR_FREE(reply); VIR_FREE(cmd);