When replacing a definition node by contents of a file the root node in
the file must match the replaced node.
Enforce that by passing the original node name as the 'rootnode'
argument of virXMLParse.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
g_autofree char *absFile = testBuildFilename(file, relFile);
xmlNodePtr newnode = NULL;
- if (!(doc = virXMLParse(absFile, NULL, NULL, NULL, NULL, NULL, false)))
+ if (!(doc = virXMLParse(absFile, NULL, NULL, (const char *) node->name,
+ NULL, NULL, false)))
return NULL;
if (!(newnode = xmlCopyNode(xmlDocGetRootElement(doc), 1))) {