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:
Mark McLoughlin 2006-07-07 14:36:27 +00:00
parent e2bd543163
commit 4d56d3c638
2 changed files with 16 additions and 12 deletions

View File

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

View File

@ -944,11 +944,8 @@ 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);
goto error;
}
for (i = 0; i < obj->nodesetval->nodeNr; i++) { for (i = 0; i < obj->nodesetval->nodeNr; i++) {
virBufferAdd(&buf, "(device ", 8); virBufferAdd(&buf, "(device ", 8);
res = virDomainParseXMLDiskDesc(obj->nodesetval->nodeTab[i], &buf); res = virDomainParseXMLDiskDesc(obj->nodesetval->nodeTab[i], &buf);
@ -957,7 +954,9 @@ virDomainParseXMLDesc(const char *xmldesc, char **name)
} }
virBufferAdd(&buf, ")", 1); 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)) {