1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

Rename virtTestLoadFile to virTestLoadFile.

This function doesn't follow our convention of naming functions.
This commit is contained in:
Tomáš Ryšavý 2016-05-26 17:01:52 +02:00 committed by John Ferlan
parent 062ea148a0
commit 401bb813bd
21 changed files with 28 additions and 28 deletions

View File

@ -89,10 +89,10 @@ testCompareXMLToXMLFiles(const char *inxml,
if (redefine)
flags |= VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE;
if (virtTestLoadFile(inxml, &inXmlData) < 0)
if (virTestLoadFile(inxml, &inXmlData) < 0)
goto cleanup;
if (virtTestLoadFile(outxml, &outXmlData) < 0)
if (virTestLoadFile(outxml, &outXmlData) < 0)
goto cleanup;
if (!(def = virDomainSnapshotDefParseString(inXmlData, driver.caps,

View File

@ -24,7 +24,7 @@ testCompareXMLToXMLFiles(const char *xml)
int ret = -1;
virInterfaceDefPtr dev = NULL;
if (virtTestLoadFile(xml, &xmlData) < 0)
if (virTestLoadFile(xml, &xmlData) < 0)
goto fail;
if (!(dev = virInterfaceDefParseString(xmlData)))

View File

@ -31,7 +31,7 @@ testCompareXMLToConfigFiles(const char *xmlfile,
char *actualxml = NULL;
virDomainDefPtr vmdef = NULL;
if (virtTestLoadFile(configfile, &config) < 0)
if (virTestLoadFile(configfile, &config) < 0)
goto fail;
vmdef = lxcParseConfigString(config, caps, xmlopt);

View File

@ -27,7 +27,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
int ret = -1;
virNetworkDefPtr def = NULL;
if (virtTestLoadFile(updatexml, &updateXmlData) < 0)
if (virTestLoadFile(updatexml, &updateXmlData) < 0)
goto error;
if (!(def = virNetworkDefParseFile(netxml)))

View File

@ -24,7 +24,7 @@ testCompareXMLToXMLFiles(const char *xml)
int ret = -1;
virNodeDeviceDefPtr dev = NULL;
if (virtTestLoadFile(xml, &xmlData) < 0)
if (virTestLoadFile(xml, &xmlData) < 0)
goto fail;
if (!(dev = virNodeDeviceDefParseString(xmlData, EXISTING_DEVICE, NULL)))

View File

@ -62,7 +62,7 @@ static int testCompareXMLToArgvFiles(const char *xmlfile,
int ret = -1;
virDomainDefPtr vmdef = NULL;
if (virtTestLoadFile(cmdfile, &cmd) < 0)
if (virTestLoadFile(cmdfile, &cmd) < 0)
goto fail;
if (!(vmdef = qemuParseCommandLineString(driver.caps, driver.xmlopt,

View File

@ -104,7 +104,7 @@ testQemuCaps(const void *opaque)
abs_srcdir, data->base, data->archName) < 0)
goto cleanup;
if (virtTestLoadFile(repliesFile, &replies) < 0)
if (virTestLoadFile(repliesFile, &replies) < 0)
goto cleanup;
if (!(mon = testQemuFeedMonitor(replies, data->xmlopt)))

View File

@ -135,7 +135,7 @@ testQemuCapsXML(const void *opaque)
abs_srcdir, data->base) < 0)
goto cleanup;
if (virtTestLoadFile(capsFile, &capsData) < 0)
if (virTestLoadFile(capsFile, &capsData) < 0)
goto cleanup;
if (!(capsProvided = testGetCaps(capsData, data)))

View File

@ -52,7 +52,7 @@ static int testHelpStrParsing(const void *data)
if (virAsprintf(&path, "%s/qemuhelpdata/%s", abs_srcdir, info->name) < 0)
return -1;
if (virtTestLoadFile(path, &help) < 0)
if (virTestLoadFile(path, &help) < 0)
goto cleanup;
if (!(flags = virQEMUCapsNew()))
@ -76,7 +76,7 @@ static int testHelpStrParsing(const void *data)
info->name) < 0)
goto cleanup;
if (virtTestLoadFile(path, &help) < 0)
if (virTestLoadFile(path, &help) < 0)
goto cleanup;
if (virQEMUCapsParseDeviceStr(flags, help) < 0)

View File

@ -233,12 +233,12 @@ testQemuHotplug(const void *data)
test->device_filename) < 0)
goto cleanup;
if (virtTestLoadFile(domain_filename, &domain_xml) < 0 ||
virtTestLoadFile(device_filename, &device_xml) < 0)
if (virTestLoadFile(domain_filename, &domain_xml) < 0 ||
virTestLoadFile(device_filename, &device_xml) < 0)
goto cleanup;
if (test->action != UPDATE &&
virtTestLoadFile(result_filename, &result_xml) < 0)
virTestLoadFile(result_filename, &result_xml) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(&driver, false)))

View File

@ -2159,7 +2159,7 @@ testQemuMonitorJSONGetCPUData(const void *opaque)
abs_srcdir, data->name) < 0)
goto cleanup;
if (virtTestLoadFile(jsonFile, &jsonStr) < 0)
if (virTestLoadFile(jsonFile, &jsonStr) < 0)
goto cleanup;
if (qemuMonitorTestAddItem(test, "qom-list",

View File

@ -194,7 +194,7 @@ fakeStoragePoolGetXMLDesc(virStoragePoolPtr pool,
pool->name) < 0)
return NULL;
if (virtTestLoadFile(xmlpath, &xmlbuf) < 0) {
if (virTestLoadFile(xmlpath, &xmlbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"failed to load XML file '%s'",
xmlpath);

View File

@ -109,9 +109,9 @@ testCompareStatusXMLToXMLFiles(const void *opaque)
int ret = -1;
int keepBlanksDefault = xmlKeepBlanksDefault(0);
if (virtTestLoadFile(data->inName, &inFile) < 0)
if (virTestLoadFile(data->inName, &inFile) < 0)
goto cleanup;
if (virtTestLoadFile(data->outActiveName, &outActiveFile) < 0)
if (virTestLoadFile(data->outActiveName, &outActiveFile) < 0)
goto cleanup;
/* construct faked source status XML */

View File

@ -36,7 +36,7 @@ testCompareFiles(const char *xml, const char *sexpr)
conn = virGetConnect();
if (!conn) goto fail;
if (virtTestLoadFile(sexpr, &sexprData) < 0)
if (virTestLoadFile(sexpr, &sexprData) < 0)
goto fail;
memset(&priv, 0, sizeof(priv));

View File

@ -294,7 +294,7 @@ virTestRun(const char *title,
Upon any failure, diagnose it and return -1, but don't bother trying
to preserve errno. Otherwise, return the number of bytes copied into BUF. */
int
virtTestLoadFile(const char *file, char **buf)
virTestLoadFile(const char *file, char **buf)
{
FILE *fp = fopen(file, "r");
struct stat st;
@ -693,7 +693,7 @@ virtTestCompareToFile(const char *strcontent,
char *filecontent = NULL;
char *fixedcontent = NULL;
if (virtTestLoadFile(filename, &filecontent) < 0 && !virTestGetRegenerate())
if (virTestLoadFile(filename, &filecontent) < 0 && !virTestGetRegenerate())
goto failure;
if (filecontent &&

View File

@ -51,7 +51,7 @@ bool virtTestOOMActive(void);
int virTestRun(const char *title,
int (*body)(const void *data),
const void *data);
int virtTestLoadFile(const char *file, char **buf);
int virTestLoadFile(const char *file, char **buf);
int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen);
void virtTestClearCommandPath(char *cmdset);

View File

@ -67,7 +67,7 @@ testCompareXMLtoXMLFiles(const char *xml)
if (virFileMakePath(abs_builddir "/vboxsnapshotxmldata") < 0)
goto cleanup;
if (virtTestLoadFile(xml, &xmlData) < 0)
if (virTestLoadFile(xml, &xmlData) < 0)
goto cleanup;
if (!(machine = virVBoxSnapshotConfLoadVboxFile(xml, (char*)"")))
@ -76,7 +76,7 @@ testCompareXMLtoXMLFiles(const char *xml)
if (virVBoxSnapshotConfSaveVboxFile(machine, pathResult) < 0)
goto cleanup;
if (virtTestLoadFile(pathResult, &actual) < 0)
if (virTestLoadFile(pathResult, &actual) < 0)
goto cleanup;
if (!(actual = testFilterXML(actual)))

View File

@ -49,7 +49,7 @@ testVerStrParse(const void *data)
info->name) < 0)
return -1;
if (virtTestLoadFile(path, &databuf) < 0)
if (virTestLoadFile(path, &databuf) < 0)
goto cleanup;
if ((vmware_type = vmwareDriverTypeFromString(info->vmware_type)) < 0)

View File

@ -75,7 +75,7 @@ testCompareFiles(const char *vmx, const char *xml)
char *formatted = NULL;
virDomainDefPtr def = NULL;
if (virtTestLoadFile(vmx, &vmxData) < 0)
if (virTestLoadFile(vmx, &vmxData) < 0)
goto cleanup;
if (!(def = virVMXParseConfig(&ctx, xmlopt, caps, vmxData)))

View File

@ -111,7 +111,7 @@ testCompareFormatXML(const char *xlcfg, const char *xml)
conn = virGetConnect();
if (!conn) goto fail;
if (virtTestLoadFile(xlcfg, &xlcfgData) < 0)
if (virTestLoadFile(xlcfg, &xlcfgData) < 0)
goto fail;
if (!(conf = virConfReadMem(xlcfgData, strlen(xlcfgData), 0)))

View File

@ -108,7 +108,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
conn = virGetConnect();
if (!conn) goto fail;
if (virtTestLoadFile(xmcfg, &xmcfgData) < 0)
if (virTestLoadFile(xmcfg, &xmcfgData) < 0)
goto fail;
/* Many puppies died to bring you this code. */