On Sat, Feb 07, 2009 at 06:04:22PM +0100, Guido G?nther wrote:
Hi,
attached patch makes sure we set a proper error status when the domain
doesn't show up. O.k. to apply?
ACK, this is quite a nasty scenario - we have to assume that if the PID
file doesn't ever show up, then the domain must have exited, as we have
no other way of determining the PID it launched if we daemonize it :-(
So good to see a explicit error messages, so we can get feedback if
this is actally ever happening in practice.
>From f7a6fa53008ab17eab04d63a53a33bfd455bc596 Mon Sep 17 00:00:00
2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx(a)sigxcpu.org>
Date: Sat, 7 Feb 2009 17:14:26 +0100
Subject: [PATCH] fix return status when domain doesn't show up
---
src/qemu_driver.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 4bec482..47ca6c7 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -1218,8 +1218,11 @@ static int qemudStartVMDaemon(virConnectPtr conn,
usleep(100*1000);
retries--;
}
- if (ret)
- qemudLog(QEMUD_WARN, _("Domain %s didn't show up\n"),
vm->def->name);
+ if (ret) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("Domain %s didn't show up\n"),
vm->def->name);
+ ret = -1;
+ }
} else {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to daemonize QEMU
process"));
--
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 :|