Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/conf/domain_conf.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 97cf940dad..f90f720b44 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14349,25 +14349,16 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node)
static virDomainVideoDriverDef *
virDomainVideoDriverDefParseXML(xmlNodePtr node,
- xmlXPathContextPtr ctxt G_GNUC_UNUSED)
+ xmlXPathContextPtr ctxt)
{
- xmlNodePtr cur;
virDomainVideoDriverDef *def;
int val;
g_autofree char *vgaconf = NULL;
+ VIR_XPATH_NODE_AUTORESTORE(ctxt)
- cur = node->children;
- while (cur != NULL) {
- if (cur->type == XML_ELEMENT_NODE) {
- if (!vgaconf &&
- virXMLNodeNameEqual(cur, "driver")) {
- vgaconf = virXMLPropString(cur, "vgaconf");
- }
- }
- cur = cur->next;
- }
+ ctxt->node = node;
- if (!vgaconf)
+ if (!(vgaconf = virXPathString("string(./driver/@vgaconf)", ctxt)))
return NULL;
def = g_new0(virDomainVideoDriverDef, 1);
--
2.30.2