]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Move more QEMU driver settings to common code
authorAndrea Bolognani <abologna@redhat.com>
Thu, 2 Mar 2023 17:31:00 +0000 (18:31 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Mar 2023 13:35:35 +0000 (14:35 +0100)
None of these settings is specific to the xml2argv test. Moving
them to the common code ensures the behavior of the QEMU driver
is consistent across all QEMU tests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
tests/qemuxml2argvtest.c
tests/testutilsqemu.c

index 4393578d1e7256d20a2cc34a1416877c32ce333d..3932a5d28cd93571418eca3231d42ba0ef6d8577 100644 (file)
@@ -830,32 +830,6 @@ mymain(void)
     linuxCaps = driver.caps;
     macOSCaps = testQemuCapsInitMacOS();
 
-    VIR_FREE(driver.config->vncTLSx509certdir);
-    driver.config->vncTLSx509certdir = g_strdup("/etc/pki/libvirt-vnc");
-    VIR_FREE(driver.config->spiceTLSx509certdir);
-    driver.config->spiceTLSx509certdir = g_strdup("/etc/pki/libvirt-spice");
-    VIR_FREE(driver.config->chardevTLSx509certdir);
-    driver.config->chardevTLSx509certdir = g_strdup("/etc/pki/libvirt-chardev");
-    VIR_FREE(driver.config->vxhsTLSx509certdir);
-    driver.config->vxhsTLSx509certdir = g_strdup("/etc/pki/libvirt-vxhs/dummy,path");
-    VIR_FREE(driver.config->nbdTLSx509certdir);
-    driver.config->nbdTLSx509certdir = g_strdup("/etc/pki/libvirt-nbd/dummy,path");
-
-    VIR_FREE(driver.config->vncSASLdir);
-    driver.config->vncSASLdir = g_strdup("/root/.sasl2");
-    VIR_FREE(driver.config->spiceSASLdir);
-    driver.config->spiceSASLdir = g_strdup("/root/.sasl2");
-
-    VIR_FREE(driver.config->hugetlbfs);
-    driver.config->hugetlbfs = g_new0(virHugeTLBFS, 2);
-    driver.config->nhugetlbfs = 2;
-    driver.config->hugetlbfs[0].mnt_dir = g_strdup("/dev/hugepages2M");
-    driver.config->hugetlbfs[1].mnt_dir = g_strdup("/dev/hugepages1G");
-    driver.config->hugetlbfs[0].size = 2048;
-    driver.config->hugetlbfs[0].deflt = true;
-    driver.config->hugetlbfs[1].size = 1048576;
-    driver.config->spicePassword = g_strdup("123456");
-
     virFileWrapperAddPrefix(SYSCONFDIR "/qemu/firmware",
                             abs_srcdir "/qemufirmwaredata/etc/qemu/firmware");
     virFileWrapperAddPrefix(PREFIX "/share/qemu/firmware",
index 113cbdc3dc6eabaa9fd8b925c5fa8d85cc0cdaa1..b093df8d9ed4e7555ba8d3fdac0889d4d1c39dd5 100644 (file)
@@ -686,6 +686,34 @@ int qemuTestDriverInit(virQEMUDriver *driver)
 
     qemuTestSetHostCPU(driver, driver->hostarch, NULL);
 
+    VIR_FREE(cfg->vncTLSx509certdir);
+    cfg->vncTLSx509certdir = g_strdup("/etc/pki/libvirt-vnc");
+    VIR_FREE(cfg->spiceTLSx509certdir);
+    cfg->spiceTLSx509certdir = g_strdup("/etc/pki/libvirt-spice");
+    VIR_FREE(cfg->chardevTLSx509certdir);
+    cfg->chardevTLSx509certdir = g_strdup("/etc/pki/libvirt-chardev");
+    VIR_FREE(cfg->vxhsTLSx509certdir);
+    cfg->vxhsTLSx509certdir = g_strdup("/etc/pki/libvirt-vxhs/dummy,path");
+    VIR_FREE(cfg->nbdTLSx509certdir);
+    cfg->nbdTLSx509certdir = g_strdup("/etc/pki/libvirt-nbd/dummy,path");
+
+    VIR_FREE(cfg->vncSASLdir);
+    cfg->vncSASLdir = g_strdup("/root/.sasl2");
+    VIR_FREE(cfg->spiceSASLdir);
+    cfg->spiceSASLdir = g_strdup("/root/.sasl2");
+
+    VIR_FREE(cfg->spicePassword);
+    cfg->spicePassword = g_strdup("123456");
+
+    VIR_FREE(cfg->hugetlbfs);
+    cfg->hugetlbfs = g_new0(virHugeTLBFS, 2);
+    cfg->nhugetlbfs = 2;
+    cfg->hugetlbfs[0].mnt_dir = g_strdup("/dev/hugepages2M");
+    cfg->hugetlbfs[1].mnt_dir = g_strdup("/dev/hugepages1G");
+    cfg->hugetlbfs[0].size = 2048;
+    cfg->hugetlbfs[0].deflt = true;
+    cfg->hugetlbfs[1].size = 1048576;
+
     driver->privileged = true;
 
     return 0;