提交 2b50a11a 编写于 作者: P Pavel Hrdina

tests: use global virQEMUDriver

Most tests already use global driver variable that is initialized
before any test case is executed, convert these remaining tests to
the same concept.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 060de835
......@@ -31,6 +31,10 @@
#define VIR_FROM_THIS VIR_FROM_NONE
virQEMUDriver driver;
static int
testQemuAgentFSFreeze(const void *data)
{
......@@ -167,7 +171,6 @@ static int
testQemuAgentGetFSInfo(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
virCapsPtr caps = testQemuCapsInit();
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
char *domain_filename = NULL;
virDomainDefPtr def = NULL;
......@@ -181,7 +184,7 @@ testQemuAgentGetFSInfo(const void *data)
abs_srcdir) < 0)
goto cleanup;
if (!(def = virDomainDefParseFile(domain_filename, caps, xmlopt,
if (!(def = virDomainDefParseFile(domain_filename, driver.caps, xmlopt,
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
......@@ -293,7 +296,6 @@ testQemuAgentGetFSInfo(const void *data)
virDomainFSInfoFree(info[i]);
VIR_FREE(info);
VIR_FREE(domain_filename);
virObjectUnref(caps);
virDomainDefFree(def);
qemuMonitorTestFree(test);
return ret;
......@@ -903,7 +905,6 @@ testQemuAgentGetInterfaces(const void *data)
static int
mymain(void)
{
virQEMUDriver driver;
int ret = 0;
#if !WITH_YAJL
......
......@@ -45,7 +45,6 @@
VIR_LOG_INIT("tests.securityselinuxlabeltest");
static virCapsPtr caps;
static virQEMUDriver driver;
static virSecurityManagerPtr mgr;
......@@ -189,7 +188,8 @@ testSELinuxLoadDef(const char *testname)
abs_srcdir, testname) < 0)
goto cleanup;
if (!(def = virDomainDefParseFile(xmlfile, caps, driver.xmlopt, NULL, 0)))
if (!(def = virDomainDefParseFile(xmlfile, driver.caps, driver.xmlopt,
NULL, 0)))
goto cleanup;
for (i = 0; i < def->ndisks; i++) {
......@@ -357,9 +357,6 @@ mymain(void)
return EXIT_FAILURE;
}
if ((caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
if (qemuTestDriverInit(&driver) < 0)
return EXIT_FAILURE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册