]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Report qemu log data if we fail to daemonize the process.
authorCole Robinson <crobinso@redhat.com>
Mon, 11 May 2009 13:37:19 +0000 (13:37 +0000)
committerCole Robinson <crobinso@redhat.com>
Mon, 11 May 2009 13:37:19 +0000 (13:37 +0000)
This ensures the user will actually see 'hook' function error output.

ChangeLog
src/qemu_driver.c

index 07681e2fc2d36e00ccf7cc139dd7e8006c015b86..f56fcc5f8c433c78fba3ff0c2721e06bac59123f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon May 11 09:35:26 EDT 2009 Cole Robinson <crobinso@redhat.com>
+
+       * src/qemu_driver.c: Report qemu log data if we fail to daemonize.
+
 Mon May 11 09:29:52 EDT 2009 Cole Robinson <crobinso@redhat.com>
 
        * src/libvirt_private.syms src/util.[ch]: Add a helper function
index bafdd73f78aedd34dbdddb32e426268156e0904a..5c8d336a1d222791624136dc0b95cd2c4a1c5d28 100644 (file)
@@ -1456,8 +1456,17 @@ static int qemudStartVMDaemon(virConnectPtr conn,
                              _("Domain %s didn't show up\n"), vm->def->name);
             ret = -1;
         }
-    } else
-        ret = -1;
+    } else if (ret == -2) {
+        /* The virExec process that launches the daemon failed. Pending on
+         * when it failed (we can't determine for sure), there may be
+         * extra info in the domain log (if the hook failed for example).
+         *
+         * Pretend like things succeeded, and let 'WaitForMonitor' report
+         * the log contents for us.
+         */
+        vm->pid = child;
+        ret = 0;
+    }
 
     vm->state = migrateFrom ? VIR_DOMAIN_PAUSED : VIR_DOMAIN_RUNNING;