Use qemuProcessCreateCmd instead duplicating required steps from
qemuProcessStart.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tests/qemuxml2argvtest.c | 38 +++-----------------------------------
1 file changed, 3 insertions(+), 35 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 43747e7..ca7d6b7 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -264,7 +264,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
char *log = NULL;
virCommandPtr cmd = NULL;
size_t i;
- virBitmapPtr nodeset = NULL;
qemuDomainObjPrivatePtr priv = NULL;
if (!(conn = virGetConnect()))
@@ -272,9 +271,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
conn->secretDriver = &fakeSecretDriver;
conn->storageDriver = &fakeStorageDriver;
- if (virBitmapParse("0-3", '\0', &nodeset, 4) < 0)
- goto out;
-
if (!(vm = virDomainObjNew(driver.xmlopt)))
goto out;
@@ -294,11 +290,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
vm->def->id = -1;
- 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, priv->libDir) < 0)
@@ -333,9 +324,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
virQEMUCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
}
- if (qemuAssignDeviceAliases(vm->def, extraFlags) < 0)
- goto out;
-
for (i = 0; i < vm->def->nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i];
@@ -346,28 +334,9 @@ static int testCompareXMLToArgvFiles(const char *xml,
}
}
- for (i = 0; i < vm->def->ndisks; i++) {
- if (virStorageTranslateDiskSourcePool(conn, vm->def->disks[i]) < 0)
- goto out;
- }
-
- if (qemuProcessStartValidate(&driver, vm, extraFlags,
- !!migrateURI, false,
- VIR_QEMU_PROCESS_START_COLD |
- VIR_QEMU_PROCESS_START_PRETEND) < 0) {
- if (flags & FLAG_EXPECT_FAILURE)
- goto ok;
- goto out;
- }
-
- if (!(cmd = qemuBuildCommandLine(conn, &driver, NULL, vm->def,
&monitor_chr,
- (flags & FLAG_JSON), extraFlags,
- migrateURI, NULL,
- VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
- &testCallbacks, false,
- (flags & FLAG_FIPS),
- nodeset, NULL, NULL,
- priv->libDir, priv->channelTargetDir))) {
+ if (!(cmd = qemuProcessCreateCmd(conn, &driver, vm, migrateURI,
+ (flags & FLAG_FIPS), false,
+ VIR_QEMU_PROCESS_START_COLD))) {
if (flags & FLAG_EXPECT_FAILURE)
goto ok;
goto out;
@@ -407,7 +376,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
virCommandFree(cmd);
virObjectUnref(vm);
virObjectUnref(conn);
- virBitmapFree(nodeset);
return ret;
}
--
2.7.2