]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/xml.c: apply patch from Masayuki Sunou about an uninitialized
authorDaniel Veillard <veillard@redhat.com>
Mon, 4 Jun 2007 08:42:41 +0000 (08:42 +0000)
committerDaniel Veillard <veillard@redhat.com>
Mon, 4 Jun 2007 08:42:41 +0000 (08:42 +0000)
  string when attaching a device
Daniel

ChangeLog
src/xml.c

index 8bb3e8ebe4e8b938021097851811792c9a500ed1..544ea11045796642fde06ba324e8009d9fd3be0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jun  4 10:41:25 CEST 2007 Daniel Veillard <veillard@redhat.com>
+
+       * src/xml.c: apply patch from Masayuki Sunou about an uninitialized
+         string when attaching a device
+
 Fri Jun  1 16:02:12 CEST 2007 Daniel Veillard <veillard@redhat.com>
 
        * src/xml.c: added a comment about (type ioemu) not needed
index bcce322006fa522f97baf26ebf34c49e6675abba..7f9a60ee15a028331269c789b98c88753b7d4f0a 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -1482,6 +1482,7 @@ virParseXMLDevice(virConnectPtr conn, char *xmldesc, int hvm, int xendConfigVers
         return (NULL);
     buf.size = 1000;
     buf.use = 0;
+    buf.content[0] = 0;
     xml = xmlReadDoc((const xmlChar *) xmldesc, "domain.xml", NULL,
                      XML_PARSE_NOENT | XML_PARSE_NONET |
                      XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
@@ -1493,6 +1494,9 @@ virParseXMLDevice(virConnectPtr conn, char *xmldesc, int hvm, int xendConfigVers
     if (xmlStrEqual(node->name, BAD_CAST "disk")) {
         if (virDomainParseXMLDiskDesc(conn, node, &buf, hvm, xendConfigVersion) != 0)
             goto error;
+        /* SXP is not created when device is "floppy". */
+       else if (buf.use == 0)
+           goto error;
     }
     else if (xmlStrEqual(node->name, BAD_CAST "interface")) {
         if (virDomainParseXMLIfDesc(conn, node, &buf, hvm) != 0)