QEmu config error handling fixes

* src/qemu_conf.c: applied 2 patches from Guido Guenther to avoid
  crashes when reading the config file
Daniel
This commit is contained in:
Daniel Veillard 2008-02-06 16:24:28 +00:00
parent 5419d0b44d
commit eecd68364a
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Wed Feb 6 17:22:34 CET 2008 Daniel Veillard <veillard@redhat.com>
* src/qemu_conf.c: applied 2 patches from Guido Guenther to avoid
crashes when reading the config file
Tue Feb 3 20:26:53 CET 2008 Jim Meyering <meyering@redhat.com> Tue Feb 3 20:26:53 CET 2008 Jim Meyering <meyering@redhat.com>
Fix new "make distcheck" failures. Fix new "make distcheck" failures.

View File

@ -1193,6 +1193,8 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn,
} else if (!strcmp((char *)prop, "network")) { } else if (!strcmp((char *)prop, "network")) {
def->os.bootDevs[def->os.nBootDevs++] = QEMUD_BOOT_NET; def->os.bootDevs[def->os.nBootDevs++] = QEMUD_BOOT_NET;
} else { } else {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"unknown boot dev \'%s\'", (char*)prop);
goto error; goto error;
} }
xmlFree(prop); xmlFree(prop);
@ -2523,7 +2525,8 @@ qemudLoadConfig(struct qemud_driver *driver,
if (!(def = qemudParseVMDef(NULL, driver, xml, file))) { if (!(def = qemudParseVMDef(NULL, driver, xml, file))) {
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
qemudLog(QEMUD_WARN, "Error parsing QEMU guest config '%s' : %s", qemudLog(QEMUD_WARN, "Error parsing QEMU guest config '%s' : %s",
path, err->message); path, err ? err->message :
"BUG: unknown error - please report it\n");
return NULL; return NULL;
} }