libvirt domain: Allow network drives with no <host> elements.

This is valid for some network drives:

<source protocol='rbd' name='abc-def/ghi-jkl'/>

instead of this:

<source protocol='rbd' name='abc-def/ghi-jkl'>
  <host name='foo' port='1234'/>
</source>

Allow both forms.
This commit is contained in:
Richard W.M. Jones
2014-01-23 11:05:01 +00:00
parent 992a6b2970
commit 58ada01783

View File

@@ -541,8 +541,7 @@ for_each_disk (guestfs_h *g,
xphost = xmlXPathEvalExpression (BAD_CAST "./source/host",
xpathCtx);
if (xphost == NULL ||
xphost->nodesetval == NULL ||
xphost->nodesetval->nodeNr == 0)
xphost->nodesetval == NULL)
continue;
/* This gives us a list of <host> elements, which each have a