mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
* src/xml.c: patch for rhbz#214741, when using pygrub
do not push the os image information for domain creation via xend Daniel
This commit is contained in:
parent
1bd41d0bab
commit
e1f2b6497e
@ -1,3 +1,9 @@
|
|||||||
|
Mon Nov 27 23:27:26 CET 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/xml.c: patch for rhbz#214741, when using pygrub
|
||||||
|
do not push the os image information for domain creation
|
||||||
|
via xend
|
||||||
|
|
||||||
Wed Nov 22 17:57:58 CET 2006 Daniel Veillard <veillard@redhat.com>
|
Wed Nov 22 17:57:58 CET 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* docs//*: regenerated
|
* docs//*: regenerated
|
||||||
|
406
po/en_GB.po
406
po/en_GB.po
File diff suppressed because it is too large
Load Diff
406
po/libvirt.pot
406
po/libvirt.pot
File diff suppressed because it is too large
Load Diff
64
src/xml.c
64
src/xml.c
@ -1314,7 +1314,14 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
|
|||||||
if ((obj != NULL) && (obj->type == XPATH_STRING) &&
|
if ((obj != NULL) && (obj->type == XPATH_STRING) &&
|
||||||
(obj->stringval != NULL) && (obj->stringval[0] != 0)) {
|
(obj->stringval != NULL) && (obj->stringval[0] != 0)) {
|
||||||
virBufferVSprintf(&buf, "(bootloader '%s')", obj->stringval);
|
virBufferVSprintf(&buf, "(bootloader '%s')", obj->stringval);
|
||||||
bootloader = 1;
|
/*
|
||||||
|
* if using pygrub, the kernel and initrd strings are not
|
||||||
|
* significant and should be discarded
|
||||||
|
*/
|
||||||
|
if (xmlStrstr(obj->stringval, BAD_CAST "pygrub"))
|
||||||
|
bootloader = 2;
|
||||||
|
else
|
||||||
|
bootloader = 1;
|
||||||
}
|
}
|
||||||
xmlXPathFreeObject(obj);
|
xmlXPathFreeObject(obj);
|
||||||
|
|
||||||
@ -1339,35 +1346,40 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
|
|||||||
}
|
}
|
||||||
xmlXPathFreeObject(obj);
|
xmlXPathFreeObject(obj);
|
||||||
|
|
||||||
obj = xmlXPathEval(BAD_CAST "/domain/os[1]", ctxt);
|
if (bootloader != 2) {
|
||||||
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
|
obj = xmlXPathEval(BAD_CAST "/domain/os[1]", ctxt);
|
||||||
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
|
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
|
||||||
/* Analyze of the os description, based on HVM or PV. */
|
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
|
||||||
tmpobj = xmlXPathEval(BAD_CAST "string(/domain/os/type[1])", ctxt);
|
/* Analyze of the os description, based on HVM or PV. */
|
||||||
if ((tmpobj != NULL) &&
|
tmpobj = xmlXPathEval(BAD_CAST "string(/domain/os/type[1])", ctxt);
|
||||||
((tmpobj->type != XPATH_STRING) || (tmpobj->stringval == NULL) ||
|
if ((tmpobj != NULL) &&
|
||||||
(tmpobj->stringval[0] == 0))) {
|
((tmpobj->type != XPATH_STRING) || (tmpobj->stringval == NULL)
|
||||||
|
|| (tmpobj->stringval[0] == 0))) {
|
||||||
|
xmlXPathFreeObject(tmpobj);
|
||||||
|
virXMLError(VIR_ERR_OS_TYPE, nam, 0);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((tmpobj == NULL)
|
||||||
|
|| !xmlStrEqual(tmpobj->stringval, BAD_CAST "hvm")) {
|
||||||
|
res = virDomainParseXMLOSDescPV(obj->nodesetval->nodeTab[0],
|
||||||
|
&buf, ctxt, xendConfigVersion);
|
||||||
|
} else {
|
||||||
|
hvm = 1;
|
||||||
|
res = virDomainParseXMLOSDescHVM(obj->nodesetval->nodeTab[0],
|
||||||
|
&buf, ctxt, xendConfigVersion);
|
||||||
|
}
|
||||||
|
|
||||||
xmlXPathFreeObject(tmpobj);
|
xmlXPathFreeObject(tmpobj);
|
||||||
virXMLError(VIR_ERR_OS_TYPE, nam, 0);
|
|
||||||
|
if (res != 0)
|
||||||
|
goto error;
|
||||||
|
} else if (bootloader == 0) {
|
||||||
|
virXMLError(VIR_ERR_NO_OS, nam, 0);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
xmlXPathFreeObject(obj);
|
||||||
if ((tmpobj == NULL) || !xmlStrEqual(tmpobj->stringval, BAD_CAST "hvm")) {
|
|
||||||
res = virDomainParseXMLOSDescPV(obj->nodesetval->nodeTab[0], &buf, ctxt, xendConfigVersion);
|
|
||||||
} else {
|
|
||||||
hvm = 1;
|
|
||||||
res = virDomainParseXMLOSDescHVM(obj->nodesetval->nodeTab[0], &buf, ctxt, xendConfigVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
xmlXPathFreeObject(tmpobj);
|
|
||||||
|
|
||||||
if (res != 0)
|
|
||||||
goto error;
|
|
||||||
} else if (bootloader == 0) {
|
|
||||||
virXMLError(VIR_ERR_NO_OS, nam, 0);
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
xmlXPathFreeObject(obj);
|
|
||||||
|
|
||||||
/* analyze of the devices */
|
/* analyze of the devices */
|
||||||
obj = xmlXPathEval(BAD_CAST "/domain/devices/disk", ctxt);
|
obj = xmlXPathEval(BAD_CAST "/domain/devices/disk", ctxt);
|
||||||
|
Loading…
Reference in New Issue
Block a user