From 63dc0474689345cf82380dfebe16182340aeaada Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 13 Sep 2007 22:06:54 +0000 Subject: [PATCH] Fixed PXE network boot config --- ChangeLog | 8 ++++++++ src/qemu_conf.c | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml | 2 +- tests/qemuxml2argvtest.c | 4 ++-- tests/qemuxml2xmltest.c | 3 ++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ca3407800..2ceefeb3de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Sep 13 17:58:00 EST 2007 Daniel P. Berrange + + * src/qemu_conf.c: Fix handling of tag for network PXE + * tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml: Fix test + for network PXE boot element + * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Fixed potential + SEGV crash in error case cleanup + Wed Sep 12 16:35:00 BST 2007 Richard W.M. Jones * src/xend_internal.c, src/xml.c, src/xml.h: Properly check buffer diff --git a/src/qemu_conf.c b/src/qemu_conf.c index 2bbd07253c..cc41a57765 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -1180,7 +1180,7 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn, def->os.bootDevs[def->os.nBootDevs++] = QEMUD_BOOT_FLOPPY; } else if (!strcmp((char *)prop, "cdrom")) { def->os.bootDevs[def->os.nBootDevs++] = QEMUD_BOOT_CDROM; - } else if (!strcmp((char *)prop, "net")) { + } else if (!strcmp((char *)prop, "network")) { def->os.bootDevs[def->os.nBootDevs++] = QEMUD_BOOT_NET; } else { goto error; @@ -2819,7 +2819,7 @@ char *qemudGenerateXML(virConnectPtr conn, boottype = "cdrom"; break; case QEMUD_BOOT_NET: - boottype = "net"; + boottype = "network"; break; } if (virBufferVSprintf(buf, " \n", boottype) < 0) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml index 55d4e8a172..7ee75257a9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml @@ -6,7 +6,7 @@ 1 hvm - + destroy diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ea4b046588..8f0af1205a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -79,8 +79,8 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmd) { } free(argv); } - - qemudFreeVMDef(vmdef); + if (vmdef) + qemudFreeVMDef(vmdef); return ret; } diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index edfee05955..29e57c4c48 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -48,7 +48,8 @@ static int testCompareXMLToXMLFiles(const char *xml) { fail: free(actual); - qemudFreeVMDef(vmdef); + if (vmdef) + qemudFreeVMDef(vmdef); return ret; }