]> xenbits.xensource.com Git - libvirt.git/commitdiff
Scrap media eject output to try and determine success/fail.
authorCole Robinson <crobinso@redhat.com>
Wed, 3 Sep 2008 14:43:34 +0000 (14:43 +0000)
committerCole Robinson <crobinso@redhat.com>
Wed, 3 Sep 2008 14:43:34 +0000 (14:43 +0000)
ChangeLog
src/qemu_driver.c

index 32cdeb956409b9713bb41573df9dee472e1b036d..ce19e508f7c909cee6a872be00d2ab238b90db9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index f71b6e8569f1e3d92c1bb5802d1d378740e3d3c9..649a0a5adb7ada4ab437aff561a66a2d89b125d5 100644 (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);