Trying to parse <driver> node which does not exist makes no sense.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/domain_conf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4cd9ffc194..fda1c6caa6 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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 &&
--
2.38.1