mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
testParseXMLDocFromFile: Remove 'type' argument
virXMLParse ignores the 'url' argument which is what 'type' was passed to it as when a filename is used as source for the XML. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
880e45e017
commit
b46667ac6f
@ -842,8 +842,7 @@ testDomainObjCheckTaint(virDomainObj *obj)
|
|||||||
|
|
||||||
static xmlNodePtr
|
static xmlNodePtr
|
||||||
testParseXMLDocFromFile(xmlNodePtr node,
|
testParseXMLDocFromFile(xmlNodePtr node,
|
||||||
const char *file,
|
const char *file)
|
||||||
const char *type)
|
|
||||||
{
|
{
|
||||||
g_autoptr(xmlDoc) doc = NULL;
|
g_autoptr(xmlDoc) doc = NULL;
|
||||||
g_autofree char *relFile = NULL;
|
g_autofree char *relFile = NULL;
|
||||||
@ -852,7 +851,7 @@ testParseXMLDocFromFile(xmlNodePtr node,
|
|||||||
g_autofree char *absFile = testBuildFilename(file, relFile);
|
g_autofree char *absFile = testBuildFilename(file, relFile);
|
||||||
xmlNodePtr newnode = NULL;
|
xmlNodePtr newnode = NULL;
|
||||||
|
|
||||||
if (!(doc = virXMLParse(absFile, NULL, type, NULL, NULL, NULL, false)))
|
if (!(doc = virXMLParse(absFile, NULL, NULL, NULL, NULL, NULL, false)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(newnode = xmlCopyNode(xmlDocGetRootElement(doc), 1))) {
|
if (!(newnode = xmlCopyNode(xmlDocGetRootElement(doc), 1))) {
|
||||||
@ -969,8 +968,7 @@ testParseDomainSnapshots(testDriver *privconn,
|
|||||||
for (i = 0; i < nsdata->num_snap_nodes; i++) {
|
for (i = 0; i < nsdata->num_snap_nodes; i++) {
|
||||||
virDomainMomentObj *snap;
|
virDomainMomentObj *snap;
|
||||||
g_autoptr(virDomainSnapshotDef) def = NULL;
|
g_autoptr(virDomainSnapshotDef) def = NULL;
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
"domainsnapshot");
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1024,7 +1022,7 @@ testParseDomains(testDriver *privconn,
|
|||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
g_autoptr(virDomainDef) def = NULL;
|
g_autoptr(virDomainDef) def = NULL;
|
||||||
testDomainNamespaceDef *nsdata;
|
testDomainNamespaceDef *nsdata;
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "domain");
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
if (!node)
|
if (!node)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -1088,7 +1086,7 @@ testParseNetworks(testDriver *privconn,
|
|||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
g_autoptr(virNetworkDef) def = NULL;
|
g_autoptr(virNetworkDef) def = NULL;
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "network");
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
if (!node)
|
if (!node)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1124,8 +1122,7 @@ testParseInterfaces(testDriver *privconn,
|
|||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
g_autoptr(virInterfaceDef) def = NULL;
|
g_autoptr(virInterfaceDef) def = NULL;
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
"interface");
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1165,8 +1162,7 @@ testOpenVolumesForPool(const char *file,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
"volume");
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1209,8 +1205,7 @@ testParseStorage(testDriver *privconn,
|
|||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
virStoragePoolDef *def;
|
virStoragePoolDef *def;
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
"pool");
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1258,8 +1253,8 @@ testParseNodedevs(testDriver *privconn,
|
|||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
virNodeDeviceDef *def;
|
virNodeDeviceDef *def;
|
||||||
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
|
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file);
|
||||||
"nodedev");
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user