[Libvir] Re: [PATCH] add missing qemudReportError

Guido Guenther agx at sigxcpu.org
Tue Feb 5 12:09:15 UTC 2008


On Tue, Feb 05, 2008 at 01:06:14PM +0100, Guido Guenther wrote:
> without this qemudParseVMDef might return NULL when the boot dev
> configuration is invalid but virGetLastError returns NULL either since
> no error has been set, this leads to a segfault in qemudLoadConfig when
> trying to print the error message.
That said it might also be worthwhile to not let libvirtd segfault
because of a missing call to qemudReportError - this is debatable
though:
 -- Guido

diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 48ccc60..bed5bf7 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -2524,7 +2525,7 @@ qemudLoadConfig(struct qemud_driver *driver,
     if (!(def = qemudParseVMDef(NULL, driver, xml, file))) {
         virErrorPtr err = virGetLastError();
         qemudLog(QEMUD_WARN, "Error parsing QEMU guest config '%s' : %s",
-                 path, err->message);
+                 path, err ? err->message : "BUG: unknown error -
please report\n");
         return NULL;
     }
 




More information about the libvir-list mailing list