From: Peter Krempa Date: Wed, 8 Mar 2023 16:34:25 +0000 (+0100) Subject: qemuxml2argvtest: Remove infrastructure for fake-caps testing on OSX X-Git-Tag: v9.3.0-rc1~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8704a59e2157d0a36b12d18db7c7d03754fe2875;p=thirdparty%2Flibvirt.git qemuxml2argvtest: Remove infrastructure for fake-caps testing on OSX The last tests using it were refactored to use real capabilities and no new tests should ever use it. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander Reviewed-by: Ján Tomko --- diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index e9d534a610..7f3b2985eb 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -31,8 +31,6 @@ # define VIR_FROM_THIS VIR_FROM_QEMU static virQEMUDriver driver; -static virCaps *linuxCaps; -static virCaps *macOSCaps; static unsigned char * fakeSecretGetValue(virSecretPtr obj G_GNUC_UNUSED, @@ -605,18 +603,12 @@ testCompareXMLToArgv(const void *data) g_autofree char *archstr = NULL; virArch arch = VIR_ARCH_NONE; g_autoptr(virIdentity) sysident = virIdentityGetSystem(); - int rc; memset(&monitor_chr, 0, sizeof(monitor_chr)); if (testQemuInfoInitArgs((struct testQemuInfo *) info) < 0) goto cleanup; - if (info->args.hostOS == HOST_OS_MACOS) - driver.caps = macOSCaps; - else - driver.caps = linuxCaps; - if (info->arch != VIR_ARCH_NONE && info->arch != VIR_ARCH_X86_64) qemuTestSetHostArch(&driver, info->arch); @@ -664,11 +656,7 @@ testCompareXMLToArgv(const void *data) virFileCacheClear(driver.qemuCapsCache); - if (info->args.hostOS == HOST_OS_MACOS) - rc = qemuTestCapsCacheInsertMacOS(driver.qemuCapsCache, info->qemuCaps); - else - rc = qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps); - if (rc < 0) + if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps) < 0) goto cleanup; if (info->migrateFrom && @@ -823,13 +811,6 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; - /* By default, the driver gets a virCaps instance that's suitable for - * tests that expect Linux as the host OS. We create another one for - * macOS and keep around pointers to both: this allows us to later - * pick the appropriate one for each test case */ - linuxCaps = driver.caps; - macOSCaps = testQemuCapsInitMacOS(); - virFileWrapperAddPrefix("/sys/devices/system", abs_srcdir "/vircaps2xmldata/linux-basic/system"); virFileWrapperAddPrefix(SYSCONFDIR "/qemu/firmware", @@ -956,10 +937,6 @@ mymain(void) DO_TEST_FULL(name, "", \ ARG_GIC, gic, \ ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) -# define DO_TEST_MACOS(name, ...) \ - DO_TEST_FULL(name, "", \ - ARG_HOST_OS, HOST_OS_MACOS, \ - ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, "", \