mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 18:05:20 +00:00
Wed Jul 5 17:11:32 IST 2006 Mark McLoughlin <markmc@redhat.com>
* xml.c: allow a <domain> to not have any <disk> devices - e.g. when using an NFS root.
This commit is contained in:
parent
e2bd543163
commit
4d56d3c638
@ -1,3 +1,8 @@
|
|||||||
|
Wed Jul 5 17:11:32 IST 2006 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* xml.c: allow a <domain> to not have any <disk> devices - e.g.
|
||||||
|
when using an NFS root.
|
||||||
|
|
||||||
Thu Jul 6 10:32:14 CEST 2006 Daniel Veillard <veillard@redhat.com>
|
Thu Jul 6 10:32:14 CEST 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/xend_internal.c: fixed xenDaemonOpen() to try both unix and
|
* src/xend_internal.c: fixed xenDaemonOpen() to try both unix and
|
||||||
|
23
src/xml.c
23
src/xml.c
@ -944,20 +944,19 @@ virDomainParseXMLDesc(const char *xmldesc, char **name)
|
|||||||
|
|
||||||
/* analyze of the devices */
|
/* analyze of the devices */
|
||||||
obj = xmlXPathEval(BAD_CAST "/domain/devices/disk", ctxt);
|
obj = xmlXPathEval(BAD_CAST "/domain/devices/disk", ctxt);
|
||||||
if ((obj == NULL) || (obj->type != XPATH_NODESET) ||
|
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
|
||||||
(obj->nodesetval == NULL) || (obj->nodesetval->nodeNr < 1)) {
|
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
|
||||||
virXMLError(VIR_ERR_NO_DEVICE, nam, 0);
|
for (i = 0; i < obj->nodesetval->nodeNr; i++) {
|
||||||
goto error;
|
virBufferAdd(&buf, "(device ", 8);
|
||||||
}
|
res = virDomainParseXMLDiskDesc(obj->nodesetval->nodeTab[i], &buf);
|
||||||
for (i = 0; i < obj->nodesetval->nodeNr; i++) {
|
if (res != 0) {
|
||||||
virBufferAdd(&buf, "(device ", 8);
|
goto error;
|
||||||
res = virDomainParseXMLDiskDesc(obj->nodesetval->nodeTab[i], &buf);
|
}
|
||||||
if (res != 0) {
|
virBufferAdd(&buf, ")", 1);
|
||||||
goto error;
|
}
|
||||||
}
|
|
||||||
virBufferAdd(&buf, ")", 1);
|
|
||||||
}
|
}
|
||||||
xmlXPathFreeObject(obj);
|
xmlXPathFreeObject(obj);
|
||||||
|
|
||||||
obj = xmlXPathEval(BAD_CAST "/domain/devices/interface", ctxt);
|
obj = xmlXPathEval(BAD_CAST "/domain/devices/interface", ctxt);
|
||||||
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
|
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
|
||||||
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
|
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user