From nobody Tue Mar 24 01:18:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1773302383; cv=none; d=zohomail.com; s=zohoarc; b=WmeOwIywVMPB5qU42efb/fa0NYHzPDCzg58XnGF7/cp65NVyWeJvwbD7f6bqHCMCo5LFbpUUGkJEXHYyEcv3yjwJaXVnjhtG8qlq4T4JRWY1SCTxkCl4wL4PGvRHXcsXNGMh3MerDLFky5Dw4dyPoEyxH8eNvHJ/Q51VelJ4oRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773302383; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=t8fg6K+/poJpGB99C7V2jMpeVqAdWhVxWkEA76FU4Mo=; b=iiwcNQkuyo2kkBqg/6+XdKgiKoxxnKmCJ8WOLOjThwjidcdAQ3MX363585AhM5jHLl1ydLRFkbGLlESheT8HeR0e0W8yrChbVkJqVTnElJDFt/taSG5vk/H0EdP9yRdGGV9B2h5S4ghP0R31FEul0Yt497Gmj7hf74d0kFjjP4A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1773302383121580.1250139909108; Thu, 12 Mar 2026 00:59:43 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E4B6441953; Thu, 12 Mar 2026 03:59:41 -0400 (EDT) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id C680C41A99; Thu, 12 Mar 2026 03:57:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 309803F362; Thu, 12 Mar 2026 03:57:25 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7495B3F950 for ; Thu, 12 Mar 2026 03:57:24 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-68-YJvoCArpOtW8u60HyIwShg-1; Thu, 12 Mar 2026 03:57:22 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AF6B81945119 for ; Thu, 12 Mar 2026 07:57:21 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 18C151800759 for ; Thu, 12 Mar 2026 07:57:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773302244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t8fg6K+/poJpGB99C7V2jMpeVqAdWhVxWkEA76FU4Mo=; b=SRymn3k9JLhBD1Xxf2CoaO04IUlDTdDeRjodnmpCDCFvtlUA6hOpy0gk/lXFOJI13j9ubR Gf0e3qcVmaPpbQCUzxIW4ZysDCr2oPu1CP+ZuUgi8bmWcdu0Iy6w390UAJT6fIOPns6Ggi GuVhz4gbjzDfz5Fc24y9m2NEJKgbBiI= X-MC-Unique: YJvoCArpOtW8u60HyIwShg-1 X-Mimecast-MFC-AGG-ID: YJvoCArpOtW8u60HyIwShg_1773302241 To: devel@lists.libvirt.org Subject: [PATCH 1/5] tests: Drop WITH_QEMU from qemu specific tests binaries/libraries Date: Thu, 12 Mar 2026 08:57:10 +0100 Message-ID: <4f51059e3130e00f2c60c9fbdff5360c3841b8d1.1773302208.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _TOhMlND0wEM9t2l69YAhRUkr-WXlgrfHph5OgHgUqc_1773302241 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TXNDPWIR66K3YTG2NBVLQYV6D2A4T4GY X-Message-ID-Hash: TXNDPWIR66K3YTG2NBVLQYV6D2A4T4GY X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1773302385116158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Inside of tests/meson.build there is a section that builds QEMU related tests conditionally (for instance qemudomaincheckpointxml2xmltest). It makes no sense to have the same check inside source file. Or even provide alternative implementation for cases when building without QEMU (EXIT_AM_SKIP). When building without QEMU driver the test is not even compiled, so EXIT_AM_SKIP is dead code. Signed-off-by: Michal Privoznik --- tests/qemudomaincheckpointxml2xmltest.c | 31 ++----- tests/qemudomainsnapshotxml2xmltest.c | 29 ++---- tests/qemumemlocktest.c | 25 ++---- tests/qemuxmlconftest.c | 114 +++++++++++------------- tests/testutilsqemu.c | 43 +++++---- tests/testutilsqemu.h | 23 +++-- 6 files changed, 104 insertions(+), 161 deletions(-) diff --git a/tests/qemudomaincheckpointxml2xmltest.c b/tests/qemudomainchec= kpointxml2xmltest.c index 0e195dae8d..e6d9bf1a4f 100644 --- a/tests/qemudomaincheckpointxml2xmltest.c +++ b/tests/qemudomaincheckpointxml2xmltest.c @@ -9,15 +9,12 @@ #include =20 #include "testutils.h" +#include "internal.h" +#include "qemu/qemu_conf.h" +#include "checkpoint_conf.h" +#include "testutilsqemu.h" =20 -#ifdef WITH_QEMU - -# include "internal.h" -# include "qemu/qemu_conf.h" -# include "checkpoint_conf.h" -# include "testutilsqemu.h" - -# define VIR_FROM_THIS VIR_FROM_NONE +#define VIR_FROM_THIS VIR_FROM_NONE =20 static virQEMUDriver driver; =20 @@ -145,7 +142,7 @@ mymain(void) virDomainXMLOptionSetMomentPostParse(driver.xmlopt, testCheckpointPostParse); =20 -# define DO_TEST(prefix, name, inpath, outpath, time, flags) \ +#define DO_TEST(prefix, name, inpath, outpath, time, flags) \ do { \ const struct testInfo info =3D {abs_srcdir "/" inpath "/" name ".x= ml", \ abs_srcdir "/" outpath "/" name ".xm= l", \ @@ -155,17 +152,17 @@ mymain(void) ret =3D -1; \ } while (0) =20 -# define DO_TEST_INOUT(name, time, flags) \ +#define DO_TEST_INOUT(name, time, flags) \ DO_TEST("in->out", name, \ "qemudomaincheckpointxml2xmlin", \ "qemudomaincheckpointxml2xmlout", \ time, flags) -# define DO_TEST_OUT(name, flags) \ +#define DO_TEST_OUT(name, flags) \ DO_TEST("out->out", name, \ "qemudomaincheckpointxml2xmlout", \ "qemudomaincheckpointxml2xmlout", \ 0, flags | TEST_REDEFINE) -# define DO_TEST_INVALID(name) \ +#define DO_TEST_INVALID(name) \ DO_TEST("in->out", name, \ "qemudomaincheckpointxml2xmlin", \ "qemudomaincheckpointxml2xmlout", \ @@ -196,13 +193,3 @@ mymain(void) } =20 VIR_TEST_MAIN(mymain) - -#else - -int -main(void) -{ - return EXIT_AM_SKIP; -} - -#endif /* WITH_QEMU */ diff --git a/tests/qemudomainsnapshotxml2xmltest.c b/tests/qemudomainsnapsh= otxml2xmltest.c index 035c275b14..9b9168ac21 100644 --- a/tests/qemudomainsnapshotxml2xmltest.c +++ b/tests/qemudomainsnapshotxml2xmltest.c @@ -6,14 +6,11 @@ #include =20 #include "testutils.h" +#include "internal.h" +#include "qemu/qemu_conf.h" +#include "testutilsqemu.h" =20 -#ifdef WITH_QEMU - -# include "internal.h" -# include "qemu/qemu_conf.h" -# include "testutilsqemu.h" - -# define VIR_FROM_THIS VIR_FROM_NONE +#define VIR_FROM_THIS VIR_FROM_NONE =20 static virQEMUDriver driver; =20 @@ -123,7 +120,7 @@ mymain(void) virDomainXMLOptionSetMomentPostParse(driver.xmlopt, testSnapshotPostParse); =20 -# define DO_TEST(prefix, name, inpath, outpath, uuid, time, flags) \ +#define DO_TEST(prefix, name, inpath, outpath, uuid, time, flags) \ do { \ const struct testInfo info =3D {abs_srcdir "/" inpath "/" name ".x= ml", \ abs_srcdir "/" outpath "/" name ".xm= l", \ @@ -133,16 +130,16 @@ mymain(void) ret =3D -1; \ } while (0) =20 -# define DO_TEST_IN(name, uuid) DO_TEST("in->in", name, \ +#define DO_TEST_IN(name, uuid) DO_TEST("in->in", name, \ "qemudomainsnapshotxml2xmlin", \ "qemudomainsnapshotxml2xmlin", \ uuid, 0, 0) =20 -# define DO_TEST_OUT(name, uuid, internal) \ +#define DO_TEST_OUT(name, uuid, internal) \ DO_TEST("out->out", name, "qemudomainsnapshotxml2xmlout", \ "qemudomainsnapshotxml2xmlout", uuid, 0, internal | TEST_REDEF= INE) =20 -# define DO_TEST_INOUT(name, uuid, time, flags) \ +#define DO_TEST_INOUT(name, uuid, time, flags) \ DO_TEST("in->out", name, \ "qemudomainsnapshotxml2xmlin",\ "qemudomainsnapshotxml2xmlout",\ @@ -190,13 +187,3 @@ mymain(void) } =20 VIR_TEST_MAIN(mymain) - -#else - -int -main(void) -{ - return EXIT_AM_SKIP; -} - -#endif /* WITH_QEMU */ diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c index a2888732f7..0f22594ad4 100644 --- a/tests/qemumemlocktest.c +++ b/tests/qemumemlocktest.c @@ -6,16 +6,13 @@ #include =20 #include "testutils.h" +#include "internal.h" +#include "conf/domain_conf.h" +#include "qemu/qemu_domain.h" =20 -#ifdef WITH_QEMU +#include "testutilsqemu.h" =20 -# include "internal.h" -# include "conf/domain_conf.h" -# include "qemu/qemu_domain.h" - -# include "testutilsqemu.h" - -# define VIR_FROM_THIS VIR_FROM_QEMU +#define VIR_FROM_THIS VIR_FROM_QEMU =20 static virQEMUDriver driver; =20 @@ -52,7 +49,7 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; =20 -# define DO_TEST(name, memlock) \ +#define DO_TEST(name, memlock) \ do { \ static struct testInfo info =3D { \ name, memlock \ @@ -127,13 +124,3 @@ mymain(void) VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci"), VIR_TEST_MOCK("domaincaps")) - -#else - -int -main(void) -{ - return EXIT_AM_SKIP; -} - -#endif /* WITH_QEMU */ diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 187f90c9dc..cf147e70d4 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -6,33 +6,30 @@ #include =20 #include "testutils.h" +#include "internal.h" +#include "viralloc.h" +#include "viridentity.h" +#include "qemu/qemu_block.h" +#include "qemu/qemu_capabilities.h" +#include "qemu/qemu_domain.h" +#include "qemu/qemu_migration.h" +#include "qemu/qemu_passt.h" +#include "qemu/qemu_process.h" +#include "qemu/qemu_slirp.h" +#include "qemu/qemu_virtiofs.h" +#include "qemu/qemu_vhost_user.h" +#include "datatypes.h" +#include "conf/storage_conf.h" +#include "virfilewrapper.h" +#include "configmake.h" +#include "testutilsqemuschema.h" =20 -#ifdef WITH_QEMU +#define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW +#include "qemu/qemu_capspriv.h" =20 -# include "internal.h" -# include "viralloc.h" -# include "viridentity.h" -# include "qemu/qemu_block.h" -# include "qemu/qemu_capabilities.h" -# include "qemu/qemu_domain.h" -# include "qemu/qemu_migration.h" -# include "qemu/qemu_passt.h" -# include "qemu/qemu_process.h" -# include "qemu/qemu_slirp.h" -# include "qemu/qemu_virtiofs.h" -# include "qemu/qemu_vhost_user.h" -# include "datatypes.h" -# include "conf/storage_conf.h" -# include "virfilewrapper.h" -# include "configmake.h" -# include "testutilsqemuschema.h" +#include "testutilsqemu.h" =20 -# define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW -# include "qemu/qemu_capspriv.h" - -# include "testutilsqemu.h" - -# define VIR_FROM_THIS VIR_FROM_QEMU +#define VIR_FROM_THIS VIR_FROM_QEMU =20 static virQEMUDriver driver; =20 @@ -95,7 +92,7 @@ static virSecretDriver fakeSecretDriver =3D { }; =20 =20 -# define STORAGE_POOL_XML_PATH "storagepoolxml2xmlout/" +#define STORAGE_POOL_XML_PATH "storagepoolxml2xmlout/" static const unsigned char fakeUUID[VIR_UUID_BUFLEN] =3D "fakeuuid"; =20 static virStoragePoolPtr @@ -743,7 +740,7 @@ testQemuConfXMLCommon(testQemuInfo *info, if (testInfoCheckDuplicate(info) < 0) goto cleanup; =20 -# if !WITH_NBDKIT +#if !WITH_NBDKIT /* when compiled without nbdkit support we want to skip the test after * marking it as used */ if (info->args.fakeNbdkitCaps) { @@ -751,7 +748,7 @@ testQemuConfXMLCommon(testQemuInfo *info, info->prepared =3D true; goto cleanup; } -# endif /* !WITH_NBDKIT */ +#endif /* !WITH_NBDKIT */ =20 if (info->arch !=3D VIR_ARCH_NONE && info->arch !=3D VIR_ARCH_X86_64) qemuTestSetHostArch(&driver, info->arch); @@ -1302,64 +1299,64 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropr= iate * version. */ -# define DO_TEST_FULL(_name, _suffix, ...) \ +#define DO_TEST_FULL(_name, _suffix, ...) \ testRun(_name, _suffix, &ret, &testConf, __VA_ARGS__); =20 -# define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ +#define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ DO_TEST_FULL(name, "." arch "-" ver, \ ARG_CAPS_ARCH, arch, \ ARG_CAPS_VER, ver, \ __VA_ARGS__, \ ARG_END) =20 -# define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \ +#define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \ DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__) =20 -# define DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ...) \ +#define DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ...) \ DO_TEST_CAPS_INTERNAL(name, arch, ver, __VA_ARGS__) =20 -# define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ +#define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END) =20 -# define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE(name, arch) \ +#define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE(name, arch) \ DO_TEST_FULL(name, "." arch "-latest.abi-update", \ ARG_CAPS_ARCH, arch, \ ARG_CAPS_VER, "latest", \ ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \ ARG_END) =20 -# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ +#define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ARG_END) =20 -# define DO_TEST_CAPS_LATEST_NBDKIT(name, ...) \ +#define DO_TEST_CAPS_LATEST_NBDKIT(name, ...) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", ARG_NBDKIT_CAPS, __VA_AR= GS__, QEMU_NBDKIT_CAPS_LAST, ARG_END) =20 -# define DO_TEST_CAPS_LATEST(name) \ +#define DO_TEST_CAPS_LATEST(name) \ DO_TEST_CAPS_ARCH_LATEST(name, "x86_64") =20 -# define DO_TEST_CAPS_LATEST_ABI_UPDATE(name) \ +#define DO_TEST_CAPS_LATEST_ABI_UPDATE(name) \ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE(name, "x86_64") =20 -# define DO_TEST_CAPS_VER(name, ver) \ +#define DO_TEST_CAPS_VER(name, ver) \ DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) =20 -# define DO_TEST_CAPS_LATEST_PPC64(name) \ +#define DO_TEST_CAPS_LATEST_PPC64(name) \ DO_TEST_CAPS_ARCH_LATEST(name, "ppc64") =20 -# define DO_TEST_CAPS_LATEST_PPC64_HOSTCPU(name, hostcpu) \ +#define DO_TEST_CAPS_LATEST_PPC64_HOSTCPU(name, hostcpu) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, "ppc64", \ ARG_CAPS_HOST_CPU_MODEL, hostcpu) =20 -# define DO_TEST_CAPS_LATEST_PPC64_HOSTCPU_FAILURE(name, hostcpu) \ +#define DO_TEST_CAPS_LATEST_PPC64_HOSTCPU_FAILURE(name, hostcpu) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, "ppc64", \ ARG_CAPS_HOST_CPU_MODEL, hostcpu, \ ARG_FLAGS, FLAG_EXPECT_FAILURE) =20 -# define DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, arch) \ +#define DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, arch) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \ ARG_FLAGS, FLAG_EXPECT_FAILURE) =20 -# define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_FAILURE(name, arch) \ +#define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_FAILURE(name, arch) \ DO_TEST_FULL(name, "." arch "-latest.abi-update", \ ARG_CAPS_ARCH, arch, \ ARG_CAPS_VER, "latest", \ @@ -1367,24 +1364,24 @@ mymain(void) ARG_FLAGS, FLAG_EXPECT_FAILURE, \ ARG_END) =20 -# define DO_TEST_CAPS_ARCH_VER_FAILURE(name, arch, ver) \ +#define DO_TEST_CAPS_ARCH_VER_FAILURE(name, arch, ver) \ DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \ ARG_FLAGS, FLAG_EXPECT_FAILURE) =20 -# define DO_TEST_CAPS_LATEST_FAILURE(name) \ +#define DO_TEST_CAPS_LATEST_FAILURE(name) \ DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, "x86_64") =20 -# define DO_TEST_CAPS_LATEST_ABI_UPDATE_FAILURE(name) \ +#define DO_TEST_CAPS_LATEST_ABI_UPDATE_FAILURE(name) \ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_FAILURE(name, "x86_64") =20 -# define DO_TEST_CAPS_VER_FAILURE(name, ver) \ +#define DO_TEST_CAPS_VER_FAILURE(name, ver) \ DO_TEST_CAPS_ARCH_VER_FAILURE(name, "x86_64", ver) =20 -# define DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR(name, arch) \ +#define DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR(name, arch) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \ ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR) =20 -# define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR(name, arch) \ +#define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR(name, arch) \ DO_TEST_FULL(name, "." arch "-latest.abi-update", \ ARG_CAPS_ARCH, arch, \ ARG_CAPS_VER, "latest", \ @@ -1392,20 +1389,20 @@ mymain(void) ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, \ ARG_END) =20 -# define DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, arch, ver) \ +#define DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, arch, ver) \ DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \ ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR) =20 -# define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \ +#define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \ DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR(name, "x86_64") =20 -# define DO_TEST_CAPS_LATEST_ABI_UPDATE_PARSE_ERROR(name) \ +#define DO_TEST_CAPS_LATEST_ABI_UPDATE_PARSE_ERROR(name) \ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR(name, "x86_64") =20 -# define DO_TEST_CAPS_VER_PARSE_ERROR(name, ver) \ +#define DO_TEST_CAPS_VER_PARSE_ERROR(name, ver) \ DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, "x86_64", ver) =20 -# define DO_TEST_GIC(name, ver, gic) \ +#define DO_TEST_GIC(name, ver, gic) \ DO_TEST_CAPS_ARCH_VER_FULL(name, "aarch64", ver, ARG_GIC, gic, ARG_FLA= GS, FLAG_ALLOW_DUPLICATE_OUTPUT, ARG_END) =20 /* Unset or set all envvars here that are copied in qemudBuildCommandL= ine @@ -3418,12 +3415,3 @@ VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom"), VIR_TEST_MOCK("qemucpu"), VIR_TEST_MOCK("virnuma")) - -#else - -int main(void) -{ - return EXIT_AM_SKIP; -} - -#endif /* WITH_QEMU */ diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index d7f2e55330..e00e52d2a8 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -1,23 +1,22 @@ #include -#ifdef WITH_QEMU =20 -# include "testutilsqemu.h" -# include "testutilsqemuschema.h" -# include "testutilshostcpus.h" -# include "testutils.h" -# include "viralloc.h" -# include "cpu_conf.h" -# include "qemu/qemu_domain.h" -# define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW -# include "qemu/qemu_capspriv.h" -# include "virstring.h" -# include "virfilecache.h" -# include "virtpm.h" +#include +#include =20 -# include -# include +#include "testutilsqemu.h" +#include "testutilsqemuschema.h" +#include "testutilshostcpus.h" +#include "testutils.h" +#include "viralloc.h" +#include "cpu_conf.h" +#include "qemu/qemu_domain.h" +#define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW +#include "qemu/qemu_capspriv.h" +#include "virstring.h" +#include "virfilecache.h" +#include "virtpm.h" =20 -# define VIR_FROM_THIS VIR_FROM_QEMU +#define VIR_FROM_THIS VIR_FROM_QEMU =20 static virCPUDef *cpuDefault; static virCPUDef *cpuHaswell; @@ -289,8 +288,8 @@ qemuTestCapsCacheInsert(virFileCache *cache, return 0; } =20 -# define STATEDIRTEMPLATE abs_builddir "/qemustatedir-XXXXXX" -# define CONFIGDIRTEMPLATE abs_builddir "/qemuconfigdir-XXXXXX" +#define STATEDIRTEMPLATE abs_builddir "/qemustatedir-XXXXXX" +#define CONFIGDIRTEMPLATE abs_builddir "/qemuconfigdir-XXXXXX" =20 int qemuTestDriverInit(virQEMUDriver *driver) { @@ -443,8 +442,8 @@ testQemuCapsSetGIC(virQEMUCaps *qemuCaps, =20 gicCapabilities =3D g_new0(virGICCapability, 2); =20 -# define IMPL_BOTH \ - VIR_GIC_IMPLEMENTATION_KERNEL|VIR_GIC_IMPLEMENTATION_EMULATED +#define IMPL_BOTH \ + VIR_GIC_IMPLEMENTATION_KERNEL|VIR_GIC_IMPLEMENTATION_EMULATED =20 if (gic & GIC_V2) { gicCapabilities[ngicCapabilities].version =3D VIR_GIC_VERSION_2; @@ -457,7 +456,7 @@ testQemuCapsSetGIC(virQEMUCaps *qemuCaps, ngicCapabilities++; } =20 -# undef IMPL_BOTH +#undef IMPL_BOTH =20 virQEMUCapsSetGICCapabilities(qemuCaps, gicCapabilities, ngicCapabilities); @@ -465,8 +464,6 @@ testQemuCapsSetGIC(virQEMUCaps *qemuCaps, return 0; } =20 -#endif - =20 struct testQemuCapsFile { unsigned long long ver; diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index a8e0fefa84..dbc8e2dbdf 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -16,19 +16,17 @@ =20 #pragma once =20 -#ifdef WITH_QEMU +#include "capabilities.h" +#include "virfilecache.h" +#include "domain_conf.h" +#include "qemu/qemu_capabilities.h" +#include "qemu/qemu_conf.h" =20 -# include "capabilities.h" -# include "virfilecache.h" -# include "domain_conf.h" -# include "qemu/qemu_capabilities.h" -# include "qemu/qemu_conf.h" - -# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" -# define TEST_TPM_ENV_VAR "VIR_TEST_MOCK_FAKE_TPM_VERSION" -# define TPM_VER_1_2 "1.2" -# define TPM_VER_2_0 "2.0" -# define TEST_NBDKIT_PATH "/fakebindir/nbdkit" +#define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" +#define TEST_TPM_ENV_VAR "VIR_TEST_MOCK_FAKE_TPM_VERSION" +#define TPM_VER_1_2 "1.2" +#define TPM_VER_2_0 "2.0" +#define TEST_NBDKIT_PATH "/fakebindir/nbdkit" =20 enum { GIC_NONE =3D 0, @@ -187,4 +185,3 @@ testQemuInsertRealCaps(virFileCache *cache, GHashTable *capsCache, GHashTable *schemaCache, GHashTable **schema); -#endif --=20 2.52.0