mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
conf: Skip virDomainNetDefParseXMLDriver if driver_node is NULL
Trying to parse <driver> node which does not exist makes no sense. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
0e23ef8222
commit
ce7a33b48f
@ -8831,8 +8831,10 @@ virDomainNetDefParseXMLDriver(virDomainNetDef *def,
|
||||
{
|
||||
xmlNodePtr driver_node;
|
||||
|
||||
if ((driver_node = virXPathNode("./driver", ctxt)) &&
|
||||
(virDomainVirtioOptionsParseXML(driver_node, &def->virtio) < 0))
|
||||
if (!(driver_node = virXPathNode("./driver", ctxt)))
|
||||
return 0;
|
||||
|
||||
if (virDomainVirtioOptionsParseXML(driver_node, &def->virtio) < 0)
|
||||
return -1;
|
||||
|
||||
if (def->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
|
||||
|
Loading…
Reference in New Issue
Block a user