Scrap media eject output to try and determine success/fail.

This commit is contained in:
Cole Robinson 2008-09-03 14:43:34 +00:00
parent 34b1a03402
commit f4af06d812
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Wed Sep 3 10:42:00 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/qemu_driver.c: scrape media eject output to determine failure
Wed Sep 3 09:58:00 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/domain_conf.c: fix disk device ordering when parsing domain

View File

@ -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);