1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

* 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.
Daniel
This commit is contained in:
Daniel Veillard 2006-04-26 07:31:16 +00:00
parent aa13b2aa79
commit 1e01848396
2 changed files with 8 additions and 38 deletions

View File

@ -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

View File

@ -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);
virBufferVSprintf(buf, "(root '%s')", (const char *) root);
xmlFree((xmlChar *) root);
virBufferVSprintf(buf, "(args '%s')", (const char *) cmdline);
} else {
if (root != NULL)
virBufferVSprintf(buf, "(root '%s')", (const char *) root);
if (cmdline != NULL)
virBufferVSprintf(buf, "(args '%s')", (const char *) cmdline);
}
virBufferAdd(buf, ")", 1);
return (0);
}