mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemuxml2argvtest: use driver.config and priv for qemuDomainSetPrivatePaths
Update testutilsqemu to overwrite libDir and channelTargetDir and set private paths using domain's privateData. This changes is required for following patch. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
12de369aa6
commit
9dca74ee6f
@ -33,7 +33,7 @@
|
||||
<target type='virtio' name='ble'/>
|
||||
</channel>
|
||||
<channel type='unix'>
|
||||
<source path='/tmp/domain-oldname/fdsa'/>
|
||||
<source path='/tmp/channel/domain-oldname/fdsa'/>
|
||||
<target type='virtio' name='fdsa'/>
|
||||
</channel>
|
||||
<memballoon model='none'/>
|
||||
|
@ -265,8 +265,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
virCommandPtr cmd = NULL;
|
||||
size_t i;
|
||||
virBitmapPtr nodeset = NULL;
|
||||
char *domainLibDir = NULL;
|
||||
char *domainChannelTargetDir = NULL;
|
||||
qemuDomainObjPrivatePtr priv = NULL;
|
||||
|
||||
if (!(conn = virGetConnect()))
|
||||
goto out;
|
||||
@ -286,6 +285,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
goto ok;
|
||||
goto out;
|
||||
}
|
||||
priv = vm->privateData;
|
||||
|
||||
if (!virDomainDefCheckABIStability(vm->def, vm->def)) {
|
||||
VIR_TEST_DEBUG("ABI stability check failed on %s", xml);
|
||||
@ -294,13 +294,14 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
|
||||
vm->def->id = -1;
|
||||
|
||||
if (qemuDomainSetPrivatePaths(&domainLibDir, &domainChannelTargetDir,
|
||||
"/tmp/lib", "/tmp/channel",
|
||||
if (qemuDomainSetPrivatePaths(&priv->libDir, &priv->channelTargetDir,
|
||||
driver.config->libDir,
|
||||
driver.config->channelTargetDir,
|
||||
vm->def->name, vm->def->id) < 0)
|
||||
goto out;
|
||||
|
||||
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
||||
if (qemuProcessPrepareMonitorChr(&monitor_chr, domainLibDir) < 0)
|
||||
if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
|
||||
goto out;
|
||||
|
||||
virQEMUCapsSetList(extraFlags,
|
||||
@ -366,7 +367,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
&testCallbacks, false,
|
||||
(flags & FLAG_FIPS),
|
||||
nodeset, NULL, NULL,
|
||||
domainLibDir, domainChannelTargetDir))) {
|
||||
priv->libDir, priv->channelTargetDir))) {
|
||||
if (flags & FLAG_EXPECT_FAILURE)
|
||||
goto ok;
|
||||
goto out;
|
||||
@ -407,8 +408,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
virObjectUnref(vm);
|
||||
virObjectUnref(conn);
|
||||
virBitmapFree(nodeset);
|
||||
VIR_FREE(domainLibDir);
|
||||
VIR_FREE(domainChannelTargetDir);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -545,9 +544,6 @@ mymain(void)
|
||||
driver.config->spiceTLS = 1;
|
||||
if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
|
||||
return EXIT_FAILURE;
|
||||
VIR_FREE(driver.config->channelTargetDir);
|
||||
if (VIR_STRDUP_QUIET(driver.config->channelTargetDir, "/tmp") < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \
|
||||
parseFlags, ...) \
|
||||
|
@ -564,6 +564,13 @@ int qemuTestDriverInit(virQEMUDriver *driver)
|
||||
if (!driver->config)
|
||||
goto error;
|
||||
|
||||
/* Overwrite some default paths so it's consistent for tests. */
|
||||
VIR_FREE(driver->config->libDir);
|
||||
VIR_FREE(driver->config->channelTargetDir);
|
||||
if (VIR_STRDUP(driver->config->libDir, "/tmp/lib") < 0 ||
|
||||
VIR_STRDUP(driver->config->channelTargetDir, "/tmp/channel") < 0)
|
||||
goto error;
|
||||
|
||||
driver->caps = testQemuCapsInit();
|
||||
if (!driver->caps)
|
||||
goto error;
|
||||
|
Loading…
Reference in New Issue
Block a user