tests: Move more QEMU driver settings to common code

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>
This commit is contained in:
Andrea Bolognani 2023-03-02 18:31:00 +01:00
parent 98a6618d07
commit 09ac9e6d3c
2 changed files with 28 additions and 26 deletions

View 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",

View 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;