From nobody Mon Apr 29 15:33:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536914177094373.06803113371086; Fri, 14 Sep 2018 01:36:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C82E530034DF; Fri, 14 Sep 2018 08:36:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6815F308BE75; Fri, 14 Sep 2018 08:36:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 286834BB75; Fri, 14 Sep 2018 08:36:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8E8aA2o010211 for ; Fri, 14 Sep 2018 04:36:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 968D52010D04; Fri, 14 Sep 2018 08:36:10 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E51B62010D00 for ; Fri, 14 Sep 2018 08:36:09 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 14 Sep 2018 10:35:59 +0200 Message-Id: <20180914083603.22580-2-abologna@redhat.com> In-Reply-To: <20180914083603.22580-1-abologna@redhat.com> References: <20180914083603.22580-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] tests: Reuse qemucapabilities data for qemucaps2xml X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 14 Sep 2018 08:36:15 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" While qemucaps2xml has a meager two test cases to its name, we have plenty of data from qemucapabilities which is taken from actual QEMU binaries, covers pretty much all supported QEMU versions and architectures and is even in the right format already! Rewrite qemucaps2xml so that it uses qemucapabilities data as input. Right now we have a single test case, but we're going to add a lot more next. Signed-off-by: Andrea Bolognani --- tests/qemucaps2xmldata/all_1.6.0-1.caps | 129 ------------------ .../nodisksnapshot_1.6.0-1.caps | 128 ----------------- .../nodisksnapshot_1.6.0-1.xml | 32 ----- .../caps_1.6.0.x86_64.xml} | 12 +- tests/qemucaps2xmltest.c | 33 +++-- 5 files changed, 23 insertions(+), 311 deletions(-) delete mode 100644 tests/qemucaps2xmldata/all_1.6.0-1.caps delete mode 100644 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps delete mode 100644 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml rename tests/{qemucaps2xmldata/all_1.6.0-1.xml =3D> qemucaps2xmloutdata/ca= ps_1.6.0.x86_64.xml} (67%) diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmlda= ta/all_1.6.0-1.caps deleted file mode 100644 index d39d0bebbf..0000000000 --- a/tests/qemucaps2xmldata/all_1.6.0-1.caps +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qem= ucaps2xmldata/nodisksnapshot_1.6.0-1.caps deleted file mode 100644 index 5a0372c917..0000000000 --- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemu= caps2xmldata/nodisksnapshot_1.6.0-1.xml deleted file mode 100644 index 981344e6fd..0000000000 --- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - i686 - - - - - - - hvm - - 32 - /usr/bin/qemu-system-i386 - - - /usr/bin/qemu-system-i386 - - - - - - - - - - - - - - diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmlout= data/caps_1.6.0.x86_64.xml similarity index 67% rename from tests/qemucaps2xmldata/all_1.6.0-1.xml rename to tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml index efe86b9a12..b58f54fefd 100644 --- a/tests/qemucaps2xmldata/all_1.6.0-1.xml +++ b/tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml @@ -2,7 +2,7 @@ =20 - i686 + x86_64 @@ -10,12 +10,12 @@ =20 hvm - - 32 - /usr/bin/qemu-system-i386 + + 64 + /usr/bin/qemu-system-x86_64 - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 @@ -24,8 +24,6 @@ - - =20 diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 5b9152b04d..65dd97c0a4 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -32,7 +32,7 @@ typedef struct _testQemuData testQemuData; typedef testQemuData *testQemuDataPtr; struct _testQemuData { const char *base; - virArch guestarch; + const char *archName; }; =20 static virQEMUCapsPtr @@ -87,23 +87,28 @@ testGetCaps(char *capsData, const testQemuData *data) { virQEMUCapsPtr qemuCaps =3D NULL; virCapsPtr caps =3D NULL; + virArch arch =3D virArchFromString(data->archName); + char *binary =3D NULL; + + if (virAsprintf(&binary, "/usr/bin/qemu-system-%s", data->archName) < = 0) + goto error; =20 if ((qemuCaps =3D testQemuGetCaps(capsData)) =3D=3D NULL) { fprintf(stderr, "failed to parse qemu capabilities flags"); goto error; } =20 - if ((caps =3D virCapabilitiesNew(data->guestarch, false, false)) =3D= =3D NULL) { + if ((caps =3D virCapabilitiesNew(arch, false, false)) =3D=3D NULL) { fprintf(stderr, "failed to create the fake capabilities"); goto error; } =20 if (virQEMUCapsInitGuestFromBinary(caps, - "/usr/bin/qemu-system-i386", + binary, qemuCaps, NULL, NULL, - data->guestarch) < 0) { + arch) < 0) { fprintf(stderr, "failed to create the capabilities from qemu"); goto error; } @@ -114,6 +119,7 @@ testGetCaps(char *capsData, const testQemuData *data) error: virObjectUnref(qemuCaps); virObjectUnref(caps); + VIR_FREE(binary); return NULL; } =20 @@ -127,12 +133,12 @@ testQemuCapsXML(const void *opaque) char *capsXml =3D NULL; virCapsPtr capsProvided =3D NULL; =20 - if (virAsprintf(&xmlFile, "%s/qemucaps2xmldata/%s.xml", - abs_srcdir, data->base) < 0) + if (virAsprintf(&xmlFile, "%s/qemucaps2xmloutdata/%s.%s.xml", + abs_srcdir, data->base, data->archName) < 0) goto cleanup; =20 - if (virAsprintf(&capsFile, "%s/qemucaps2xmldata/%s.caps", - abs_srcdir, data->base) < 0) + if (virAsprintf(&capsFile, "%s/qemucapabilitiesdata/%s.%s.xml", + abs_srcdir, data->base, data->archName) < 0) goto cleanup; =20 if (virTestLoadFile(capsFile, &capsData) < 0) @@ -175,16 +181,13 @@ mymain(void) =20 virEventRegisterDefaultImpl(); =20 -#define DO_TEST_FULL(name, guest) \ +#define DO_TEST(arch, name) \ + data.archName =3D arch; \ data.base =3D name; \ - data.guestarch =3D guest; \ - if (virTestRun(name, testQemuCapsXML, &data) < 0) \ + if (virTestRun(name "(" arch ")", testQemuCapsXML, &data) < 0) \ ret =3D -1 =20 -#define DO_TEST(name) DO_TEST_FULL(name, VIR_ARCH_I686) - - DO_TEST("all_1.6.0-1"); - DO_TEST("nodisksnapshot_1.6.0-1"); + DO_TEST("x86_64", "caps_1.6.0"); =20 return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:33:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536914210724161.57084502841303; Fri, 14 Sep 2018 01:36:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 95C9E308213A; Fri, 14 Sep 2018 08:36:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42BF3101E5A5; Fri, 14 Sep 2018 08:36:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id ACDB6181A13A; Fri, 14 Sep 2018 08:36:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8E8aBoj010218 for ; Fri, 14 Sep 2018 04:36:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 98D222010D04; Fri, 14 Sep 2018 08:36:11 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E93E32010D00 for ; Fri, 14 Sep 2018 08:36:10 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 14 Sep 2018 10:36:00 +0200 Message-Id: <20180914083603.22580-3-abologna@redhat.com> In-Reply-To: <20180914083603.22580-1-abologna@redhat.com> References: <20180914083603.22580-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/5] tests: Add more tests to qemucaps2xml X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 14 Sep 2018 08:36:49 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" More specifically, everything that's tested by qemucapabilities now goes through qemucaps2xml as well. Ideally we'll rewrite both so that listing all test cases is unnecessary and they get picked up automatically by listing the contents of the input directory instead, but that's a refactor for another day :) Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiestest.c | 1 + .../qemucaps2xmloutdata/caps_1.5.3.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_1.7.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.1.1.x86_64.xml | 30 +++++++++++++++++++ .../caps_2.10.0.aarch64.xml | 29 ++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.10.0.ppc64.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.10.0.s390x.xml | 28 +++++++++++++++++ .../caps_2.10.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.11.0.s390x.xml | 28 +++++++++++++++++ .../caps_2.11.0.x86_64.xml | 30 +++++++++++++++++++ .../caps_2.12.0.aarch64.xml | 29 ++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.12.0.ppc64.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.12.0.s390x.xml | 28 +++++++++++++++++ .../caps_2.12.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.4.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.5.0.x86_64.xml | 30 +++++++++++++++++++ .../caps_2.6.0.aarch64.xml | 29 ++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.6.0.ppc64.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.6.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.7.0.s390x.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.7.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.8.0.s390x.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.8.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_2.9.0.ppc64.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.9.0.s390x.xml | 28 +++++++++++++++++ .../qemucaps2xmloutdata/caps_2.9.0.x86_64.xml | 30 +++++++++++++++++++ .../qemucaps2xmloutdata/caps_3.0.0.ppc64.xml | 28 +++++++++++++++++ .../caps_3.0.0.riscv32.xml | 25 ++++++++++++++++ .../caps_3.0.0.riscv64.xml | 25 ++++++++++++++++ .../qemucaps2xmloutdata/caps_3.0.0.x86_64.xml | 30 +++++++++++++++++++ tests/qemucaps2xmltest.c | 30 +++++++++++++++++++ 31 files changed, 866 insertions(+) create mode 100644 tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml create mode 100644 tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.riscv32.xml create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.riscv64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index e53023b3b9..498876e383 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -163,6 +163,7 @@ mymain(void) ret =3D -1; \ } while (0) =20 + /* Keep this in sync with qemucaps2xmltest */ DO_TEST("x86_64", "caps_1.5.3"); DO_TEST("x86_64", "caps_1.6.0"); DO_TEST("x86_64", "caps_1.7.0"); diff --git a/tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_1.5.3.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_1.7.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.1.1.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml b/tests/qemu= caps2xmloutdata/caps_2.10.0.aarch64.xml new file mode 100644 index 0000000000..a879d67df3 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml @@ -0,0 +1,29 @@ + + + + + aarch64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-aarch64 + + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml b/tests/qemuca= ps2xmloutdata/caps_2.10.0.ppc64.xml new file mode 100644 index 0000000000..74eaf3ba0e --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml @@ -0,0 +1,28 @@ + + + + + ppc64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml b/tests/qemuca= ps2xmloutdata/caps_2.10.0.s390x.xml new file mode 100644 index 0000000000..20ef995d62 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml @@ -0,0 +1,28 @@ + + + + + s390x + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + + + /usr/bin/qemu-system-s390x + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml b/tests/qemuc= aps2xmloutdata/caps_2.10.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml b/tests/qemuca= ps2xmloutdata/caps_2.11.0.s390x.xml new file mode 100644 index 0000000000..20ef995d62 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml @@ -0,0 +1,28 @@ + + + + + s390x + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + + + /usr/bin/qemu-system-s390x + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml b/tests/qemuc= aps2xmloutdata/caps_2.11.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml b/tests/qemu= caps2xmloutdata/caps_2.12.0.aarch64.xml new file mode 100644 index 0000000000..a879d67df3 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml @@ -0,0 +1,29 @@ + + + + + aarch64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-aarch64 + + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml b/tests/qemuca= ps2xmloutdata/caps_2.12.0.ppc64.xml new file mode 100644 index 0000000000..74eaf3ba0e --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml @@ -0,0 +1,28 @@ + + + + + ppc64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml b/tests/qemuca= ps2xmloutdata/caps_2.12.0.s390x.xml new file mode 100644 index 0000000000..20ef995d62 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml @@ -0,0 +1,28 @@ + + + + + s390x + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + + + /usr/bin/qemu-system-s390x + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml b/tests/qemuc= aps2xmloutdata/caps_2.12.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.4.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.5.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml b/tests/qemuc= aps2xmloutdata/caps_2.6.0.aarch64.xml new file mode 100644 index 0000000000..a879d67df3 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml @@ -0,0 +1,29 @@ + + + + + aarch64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-aarch64 + + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml b/tests/qemucap= s2xmloutdata/caps_2.6.0.ppc64.xml new file mode 100644 index 0000000000..74eaf3ba0e --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml @@ -0,0 +1,28 @@ + + + + + ppc64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.6.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml b/tests/qemucap= s2xmloutdata/caps_2.7.0.s390x.xml new file mode 100644 index 0000000000..20ef995d62 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml @@ -0,0 +1,28 @@ + + + + + s390x + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + + + /usr/bin/qemu-system-s390x + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.7.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml b/tests/qemucap= s2xmloutdata/caps_2.8.0.s390x.xml new file mode 100644 index 0000000000..20ef995d62 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml @@ -0,0 +1,28 @@ + + + + + s390x + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + + + /usr/bin/qemu-system-s390x + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.8.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml b/tests/qemucap= s2xmloutdata/caps_2.9.0.ppc64.xml new file mode 100644 index 0000000000..74eaf3ba0e --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml @@ -0,0 +1,28 @@ + + + + + ppc64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml b/tests/qemucap= s2xmloutdata/caps_2.9.0.s390x.xml new file mode 100644 index 0000000000..20ef995d62 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml @@ -0,0 +1,28 @@ + + + + + s390x + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + + + /usr/bin/qemu-system-s390x + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_2.9.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml b/tests/qemucap= s2xmloutdata/caps_3.0.0.ppc64.xml new file mode 100644 index 0000000000..74eaf3ba0e --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml @@ -0,0 +1,28 @@ + + + + + ppc64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.riscv32.xml b/tests/qemuc= aps2xmloutdata/caps_3.0.0.riscv32.xml new file mode 100644 index 0000000000..63c374da7f --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_3.0.0.riscv32.xml @@ -0,0 +1,25 @@ + + + + + riscv32 + + + + + + + hvm + + 32 + /usr/bin/qemu-system-riscv32 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.riscv64.xml b/tests/qemuc= aps2xmloutdata/caps_3.0.0.riscv64.xml new file mode 100644 index 0000000000..09b7eb7f2f --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_3.0.0.riscv64.xml @@ -0,0 +1,25 @@ + + + + + riscv64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-riscv64 + + + + + + + + + + diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml b/tests/qemuca= ps2xmloutdata/caps_3.0.0.x86_64.xml new file mode 100644 index 0000000000..b58f54fefd --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml @@ -0,0 +1,30 @@ + + + + + x86_64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 65dd97c0a4..e765a03b73 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -187,7 +187,37 @@ mymain(void) if (virTestRun(name "(" arch ")", testQemuCapsXML, &data) < 0) \ ret =3D -1 =20 + /* Keep this in sync with qemucapabilitiestest */ + DO_TEST("x86_64", "caps_1.5.3"); DO_TEST("x86_64", "caps_1.6.0"); + DO_TEST("x86_64", "caps_1.7.0"); + DO_TEST("x86_64", "caps_2.1.1"); + DO_TEST("x86_64", "caps_2.4.0"); + DO_TEST("x86_64", "caps_2.5.0"); + DO_TEST("x86_64", "caps_2.6.0"); + DO_TEST("x86_64", "caps_2.7.0"); + DO_TEST("x86_64", "caps_2.8.0"); + DO_TEST("x86_64", "caps_2.9.0"); + DO_TEST("x86_64", "caps_2.10.0"); + DO_TEST("x86_64", "caps_2.11.0"); + DO_TEST("x86_64", "caps_2.12.0"); + DO_TEST("x86_64", "caps_3.0.0"); + DO_TEST("aarch64", "caps_2.6.0"); + DO_TEST("aarch64", "caps_2.10.0"); + DO_TEST("aarch64", "caps_2.12.0"); + DO_TEST("ppc64", "caps_2.6.0"); + DO_TEST("ppc64", "caps_2.9.0"); + DO_TEST("ppc64", "caps_2.10.0"); + DO_TEST("ppc64", "caps_2.12.0"); + DO_TEST("ppc64", "caps_3.0.0"); + DO_TEST("s390x", "caps_2.7.0"); + DO_TEST("s390x", "caps_2.8.0"); + DO_TEST("s390x", "caps_2.9.0"); + DO_TEST("s390x", "caps_2.10.0"); + DO_TEST("s390x", "caps_2.11.0"); + DO_TEST("s390x", "caps_2.12.0"); + DO_TEST("riscv32", "caps_3.0.0"); + DO_TEST("riscv64", "caps_3.0.0"); =20 return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:33:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536914213940279.15317837367263; Fri, 14 Sep 2018 01:36:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7D7088304; Fri, 14 Sep 2018 08:36:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 614BE608EC; Fri, 14 Sep 2018 08:36:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 130AA4BB7F; Fri, 14 Sep 2018 08:36:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8E8aCXX010228 for ; Fri, 14 Sep 2018 04:36:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 706A02010D04; Fri, 14 Sep 2018 08:36:12 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E93F12010D00 for ; Fri, 14 Sep 2018 08:36:11 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 14 Sep 2018 10:36:01 +0200 Message-Id: <20180914083603.22580-4-abologna@redhat.com> In-Reply-To: <20180914083603.22580-1-abologna@redhat.com> References: <20180914083603.22580-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/5] qemu: Drop QEMU_CAPS_ENABLE_KVM X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 14 Sep 2018 08:36:52 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It was already available in 1.5.0. Moreover, we're not even formatting it on the QEMU command line, ever: we just use it as part of some logic that decides whether KVM support should be advertised, and as it turns out that logic is actually buggy and dropping this capability fixes it. https://bugzilla.redhat.com/show_bug.cgi?id=3D1628469 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 3 --- src/qemu/qemu_capabilities.h | 2 +- tests/qemuxml2argvtest.c | 11 +++++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e04a3d775f..469f0283f5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -836,7 +836,6 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, =20 if (virFileExists("/dev/kvm") && (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) || - virQEMUCapsGet(qemubinCaps, QEMU_CAPS_ENABLE_KVM) || kvmbin)) haskvm =3D true; =20 @@ -2640,7 +2639,6 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps, virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM); } else if (!enabled) { virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_KVM); } =20 return 0; @@ -3938,7 +3936,6 @@ virQEMUCapsIsValid(void *data, priv->runUid, priv->runGid) =3D=3D 0; =20 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KVM) && kvmUsable) { VIR_DEBUG("KVM was not enabled when probing '%s', " "but it should be usable now", diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index a0134493aa..f00d790542 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -79,7 +79,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for sy= ntax-check */ X_QEMU_CAPS_XEN_DOMID, /* -xen-domid */ X_QEMU_CAPS_MIGRATE_QEMU_UNIX, /* qemu migration via unix sockets */ X_QEMU_CAPS_CHARDEV, /* Is the new -chardev arg available */ - QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */ + X_QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */ X_QEMU_CAPS_MONITOR_JSON, /* JSON mode for monitor */ =20 /* 25 */ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3d84cb346a..20052575ab 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -965,16 +965,15 @@ mymain(void) DO_TEST("clock-france", NONE); DO_TEST("clock-hpet-off", NONE); DO_TEST("clock-catchup", QEMU_CAPS_KVM_PIT_TICK_POLICY); - DO_TEST("cpu-kvmclock", QEMU_CAPS_ENABLE_KVM); - DO_TEST("cpu-host-kvmclock", QEMU_CAPS_ENABLE_KVM); + DO_TEST("cpu-kvmclock", NONE); + DO_TEST("cpu-host-kvmclock", NONE); DO_TEST("kvmclock", QEMU_CAPS_KVM); DO_TEST("clock-timer-hyperv-rtc", QEMU_CAPS_KVM); =20 - DO_TEST("cpu-eoi-disabled", QEMU_CAPS_ENABLE_KVM); - DO_TEST("cpu-eoi-enabled", QEMU_CAPS_ENABLE_KVM); + DO_TEST("cpu-eoi-disabled", NONE); + DO_TEST("cpu-eoi-enabled", NONE); DO_TEST("controller-order", QEMU_CAPS_KVM, - QEMU_CAPS_ENABLE_KVM, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_SPICE, @@ -986,7 +985,7 @@ mymain(void) DO_TEST("eoi-enabled", NONE); DO_TEST("pv-spinlock-disabled", NONE); DO_TEST("pv-spinlock-enabled", NONE); - DO_TEST("kvmclock+eoi-disabled", QEMU_CAPS_ENABLE_KVM); + DO_TEST("kvmclock+eoi-disabled", NONE); =20 DO_TEST("hyperv", NONE); DO_TEST("hyperv-off", NONE); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:33:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536914177773685.877092838435; Fri, 14 Sep 2018 01:36:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4ECE240F1B; Fri, 14 Sep 2018 08:36:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 119B74F80; Fri, 14 Sep 2018 08:36:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B912018005D0; Fri, 14 Sep 2018 08:36:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8E8aDwj010233 for ; Fri, 14 Sep 2018 04:36:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 498542010D04; Fri, 14 Sep 2018 08:36:13 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C29162010D00 for ; Fri, 14 Sep 2018 08:36:12 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 14 Sep 2018 10:36:02 +0200 Message-Id: <20180914083603.22580-5-abologna@redhat.com> In-Reply-To: <20180914083603.22580-1-abologna@redhat.com> References: <20180914083603.22580-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/5] qemu: Clarify QEMU_CAPS_KVM X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 14 Sep 2018 08:36:16 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This capability is documented as having one meaning (whether KVM is enabled by default) but is actually assigned two other meanings over its life: whether the query-kvm QMP command is available at first, and later on whether KVM is usable / was used during probing. Since the query-kvm QMP command was available in 1.5.0, we can avoid probing for it; additionally, we can simplify the logic by setting the flag when it applies instead of initially setting it and then clearing it when it doesn't. The flag's description is also updated to reflect reality. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 19 ++----------------- src/qemu/qemu_capabilities.h | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 469f0283f5..348b478159 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1004,7 +1004,6 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = =3D { { "block-stream", QEMU_CAPS_BLOCKJOB_ASYNC }, { "dump-guest-memory", QEMU_CAPS_DUMP_GUEST_MEMORY }, { "query-spice", QEMU_CAPS_SPICE }, - { "query-kvm", QEMU_CAPS_KVM }, { "block-commit", QEMU_CAPS_BLOCK_COMMIT }, { "query-vnc", QEMU_CAPS_VNC }, { "drive-mirror", QEMU_CAPS_DRIVE_MIRROR }, @@ -2621,25 +2620,11 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps, bool enabled =3D false; bool present =3D false; =20 - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - return 0; - if (qemuMonitorGetKVMState(mon, &enabled, &present) < 0) return -1; =20 - /* The QEMU_CAPS_KVM flag was initially set according to the QEMU - * reporting the recognition of 'query-kvm' QMP command. That merely - * indicates existence of the command though, not whether KVM support - * is actually available, nor whether it is enabled by default. - * - * If it is not present we need to clear the flag, and if it is - * not enabled by default we need to change the flag. - */ - if (!present) { - virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM); - } else if (!enabled) { - virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM); - } + if (present && enabled) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM); =20 return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f00d790542..e671f74ebb 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -65,7 +65,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for sy= ntax-check */ X_QEMU_CAPS_MIGRATE_QEMU_TCP, /* have qemu tcp migration */ X_QEMU_CAPS_MIGRATE_QEMU_EXEC, /* have qemu exec migration */ X_QEMU_CAPS_DRIVE_CACHE_V2, /* cache=3D flag wanting new v2 values */ - QEMU_CAPS_KVM, /* Whether KVM is enabled by default */ + QEMU_CAPS_KVM, /* Whether KVM is usable / was used during probing */ X_QEMU_CAPS_DRIVE_FORMAT, /* Is -drive format=3D avail */ =20 /* 15 */ --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:33:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536914232425729.5146329540007; Fri, 14 Sep 2018 01:37:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 382FB811B7; Fri, 14 Sep 2018 08:37:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC94F2010D5B; Fri, 14 Sep 2018 08:37:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 96FC04A463; Fri, 14 Sep 2018 08:37:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8E8aEII010241 for ; Fri, 14 Sep 2018 04:36:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 323512010D0F; Fri, 14 Sep 2018 08:36:14 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C1B52010D00 for ; Fri, 14 Sep 2018 08:36:13 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 14 Sep 2018 10:36:03 +0200 Message-Id: <20180914083603.22580-6-abologna@redhat.com> In-Reply-To: <20180914083603.22580-1-abologna@redhat.com> References: <20180914083603.22580-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/5] qemu: Don't check for /dev/kvm presence X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 14 Sep 2018 08:37:11 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The file being present doesn't necessarily mean anything these days, as it's created independently of whether the kvm module has been loaded; moreover, we're already gathering all the information we need through QMP, so poking the filesystem at all is entirely unnecessary. [1] https://github.com/systemd/systemd/commit/d35d6249d5a7ed3228 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 348b478159..3d99c95a6a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -834,9 +834,8 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, if (!binary) return 0; =20 - if (virFileExists("/dev/kvm") && - (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) || - kvmbin)) + if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) || + kvmbin) haskvm =3D true; =20 if (virQEMUCapsGetMachineTypesCaps(qemubinCaps, &nmachines, &machines)= < 0) --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:33:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1537183392746986.3655729937698; Mon, 17 Sep 2018 04:23:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C791B3086247; Mon, 17 Sep 2018 11:23:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EAD78AD41; Mon, 17 Sep 2018 11:23:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 21B624BB75; Mon, 17 Sep 2018 11:23:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8HBN9SL019151 for ; Mon, 17 Sep 2018 07:23:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A050308BDAA; Mon, 17 Sep 2018 11:23:09 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DEC4A308BDA0 for ; Mon, 17 Sep 2018 11:23:06 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 17 Sep 2018 13:22:59 +0200 Message-Id: <20180917112259.17901-1-abologna@redhat.com> In-Reply-To: <20180914083603.22580-1-abologna@redhat.com> References: <20180914083603.22580-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/5] qemu: Avoid probing non-native binaries all the time X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 17 Sep 2018 11:23:11 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" A side effect of recent changes is that we would always try to regenerate the capabilities cache for non-native QEMU binaries based on /dev/kvm availability, which is of course complete nonsense. Make sure that doesn't happen. Signed-off-by: Andrea Bolognani Reviewed-by: Jiri Denemark --- A better spot would be between 3/5 and 4/5, but the order doesn't make any difference functionality-wise so 6/5 it is for the sake of mailing list archives :) src/qemu/qemu_capabilities.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3d99c95a6a..04c2adcfb5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3916,6 +3916,14 @@ virQEMUCapsIsValid(void *data, return false; } =20 + if (!virQEMUCapsGuestIsNative(priv->hostArch, qemuCaps->arch)) { + VIR_DEBUG("Guest arch (%s) is not native to host arch (%s), " + "skipping KVM-related checks", + virArchToString(qemuCaps->arch), + virArchToString(priv->hostArch)); + return true; + } + kvmUsable =3D virFileAccessibleAs("/dev/kvm", R_OK | W_OK, priv->runUid, priv->runGid) =3D=3D 0; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list