mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Allow empty bridges in interface xml.
This commit is contained in:
parent
d22591efb9
commit
86304e35a3
@ -557,12 +557,13 @@ virInterfaceDefParseBridge(virConnectPtr conn, virInterfaceDefPtr def,
|
|||||||
|
|
||||||
bridge = ctxt->node;
|
bridge = ctxt->node;
|
||||||
nbItf = virXPathNodeSet(conn, "./interface", ctxt, &interfaces);
|
nbItf = virXPathNodeSet(conn, "./interface", ctxt, &interfaces);
|
||||||
if (nbItf <= 0) {
|
if (nbItf < 0) {
|
||||||
virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
|
virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
|
||||||
"%s", _("bridge has no interfaces"));
|
"%s", _("bridge interfaces"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
if (nbItf > 0) {
|
||||||
if (VIR_ALLOC_N(def->data.bridge.itf, nbItf) < 0) {
|
if (VIR_ALLOC_N(def->data.bridge.itf, nbItf) < 0) {
|
||||||
virReportOOMError(conn);
|
virReportOOMError(conn);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
@ -580,6 +581,7 @@ virInterfaceDefParseBridge(virConnectPtr conn, virInterfaceDefPtr def,
|
|||||||
}
|
}
|
||||||
def->data.bridge.itf[i] = itf;
|
def->data.bridge.itf[i] = itf;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(interfaces);
|
VIR_FREE(interfaces);
|
||||||
|
Loading…
Reference in New Issue
Block a user