]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Properly report a startup timeout error
authorCole Robinson <crobinso@redhat.com>
Tue, 9 Feb 2010 19:45:35 +0000 (14:45 -0500)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 Feb 2010 15:51:46 +0000 (10:51 -0500)
The timeout errors were unconditionally being overwritten by the less
helpful 'unable to start guest' error.

src/qemu/qemu_driver.c

index b009dd330a5f0caacbe86b41af70a4f6bed7fb97..9a26cc030295545c087c5d767feea90d3f6a6a76 100644 (file)
@@ -1351,15 +1351,15 @@ qemudReadLogOutput(virDomainObjPtr vm,
         buf[got] = '\0';
         if (got == buflen-1) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Out of space while reading %s log output"),
-                            what);
+                            _("Out of space while reading %s log output: %s"),
+                            what, buf);
             return -1;
         }
 
         if (isdead) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Process exited while reading %s log output"),
-                            what);
+                            _("Process exited while reading %s log output: %s"),
+                            what, buf);
             return -1;
         }
 
@@ -1371,7 +1371,8 @@ qemudReadLogOutput(virDomainObjPtr vm,
     }
 
     qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                    _("Timed out while reading %s log output"), what);
+                    _("Timed out while reading %s log output: %s"),
+                    what, buf);
     return -1;
 }
 
@@ -1547,12 +1548,8 @@ qemudWaitForMonitor(struct qemud_driver* driver,
                  virStrerror(errno, ebuf, sizeof ebuf));
     }
 
-    if (ret < 0) {
-        /* Unexpected end of file - inform user of QEMU log data */
-        qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("unable to start guest: %s"), buf);
+    if (ret < 0)
         return -1;
-    }
 
     VIR_DEBUG("Connect monitor to %p '%s'", vm, vm->def->name);
     if (qemuConnectMonitor(vm) < 0)