commit 8caba367b62b4fb961722cd641d8172bb441b84e Author: Cole Robinson Date: Fri Aug 22 16:35:24 2008 -0400 Scrape cdrom attach/eject monitor output to try and determine failure. diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 9a26375..05e7402 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -2994,6 +2994,19 @@ static int qemudDomainChangeCDROM(virDomainPtr dom, VIR_FREE(newsrc); 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);