]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/xml.c: applied patch from Jeremy Katz to not require a
authorDaniel Veillard <veillard@redhat.com>
Wed, 26 Apr 2006 07:31:16 +0000 (07:31 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 26 Apr 2006 07:31:16 +0000 (07:31 +0000)
  root entry in XML nor try to extract it from command line
  informations.
Daniel

ChangeLog
src/xml.c

index e65661584d20fc5d4e8eff9390d4433fd815b757..6353f98ee3b872105998413383efa8642340ae6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Apr 26 08:32:38 CEST 2006 Daniel Veillard <veillard@redhat.com>
+
+       * src/xml.c: applied patch from Jeremy Katz to not require a 
+         root entry in XML nor try to extract it from command line
+         informations.
+
 Wed Apr 26 07:45:28 CEST 2006 Daniel Veillard <veillard@redhat.com>
 
        * docs//* : fixed perl binding URL to point to CPAN as provided by
index c2669dd46b569e0198571bdfba0f36e0ad7bbf75..58646b3d85fa276cde1d9af56a7a58e8763faed8 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -569,46 +569,10 @@ virDomainParseXMLOSDesc(xmlNodePtr node, virBufferPtr buf, int bootloader)
     }
     if (initrd != NULL)
         virBufferVSprintf(buf, "(ramdisk '%s')", (const char *) initrd);
-    if (root == NULL) {
-        const xmlChar *base, *tmp;
-
-        /* need to extract root info from command line */
-        if (cmdline == NULL) {
-            virXMLError(VIR_ERR_NO_ROOT, (const char *) cmdline, 0);
-            return (-1);
-        }
-        base = cmdline;
-        while (*base != 0) {
-            if ((base[0] == 'r') && (base[1] == 'o') && (base[2] == 'o') &&
-                (base[3] == 't')) {
-                base += 4;
-                break;
-            }
-            base++;
-        }
-        while ((*base == ' ') || (*base == '\t'))
-            base++;
-        if (*base == '=') {
-            base++;
-            while ((*base == ' ') || (*base == '\t'))
-                base++;
-        }
-        tmp = base;
-        while ((*tmp != 0) && (*tmp != ' ') && (*tmp != '\t'))
-            tmp++;
-        if (tmp == base) {
-            virXMLError(VIR_ERR_NO_ROOT, (const char *) cmdline, 0);
-            return (-1);
-        }
-        root = xmlStrndup(base, tmp - base);
+    if (root != NULL)
         virBufferVSprintf(buf, "(root '%s')", (const char *) root);
-        xmlFree((xmlChar *) root);
+    if (cmdline != NULL)
         virBufferVSprintf(buf, "(args '%s')", (const char *) cmdline);
-    } else {
-        virBufferVSprintf(buf, "(root '%s')", (const char *) root);
-        if (cmdline != NULL)
-            virBufferVSprintf(buf, "(args '%s')", (const char *) cmdline);
-    }
     virBufferAdd(buf, ")", 1);
     return (0);
 }