On Tue, Apr 28, 2009 at 11:31:54AM -0400, Cole Robinson wrote:
This ensures the user will actually see 'hook' function error
output.
---
src/qemu_driver.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index cc510b2..5200532 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -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;
ACK
Daniel
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|