From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183519; cv=none; d=zohomail.com; s=zohoarc; b=AORQoXG1iujZaLV/JlWXrnDcmJ3kJpxQn/aCYEmJxA5BYr86yU7JpPyBeClGLoRwqbO5Zn5XL0qKlKpoDGL2hxruvl3KBUdE9sovmQ501CHemcGx/odTlgDUd4qQ3Yu4fqzVqKdpE8AuAmo3yJcZEhnci9mwbt6jqYhIM+2pdoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183519; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MWwWE1LrMKtsYoUVkyf0fUfWeY94FjfQpjDsQixqgAs=; b=NIv5LIGoPWyIMd/ZLKpuYIUfLAgemJIeYZUPA9NPhHu2THDNv0magG0JqnPnC7rq0Q3DcQM88DyoI4uaENh0HzOIdVcZdF0VhHe+cOWFYd7A6U22BnwYSeGOsoxm0LDSKO2xGAZspwJY0ooFNo1iKpekqssZNPkvOUq6niKtH84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183519372718.5939855197722; Thu, 30 Mar 2023 06:38:39 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-394-uAM9-XyHMXegp-75KxgbcA-1; Thu, 30 Mar 2023 09:38:35 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 443D185C06A; Thu, 30 Mar 2023 13:38:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94292492C3E; Thu, 30 Mar 2023 13:38:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B180119465B3; Thu, 30 Mar 2023 13:38:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7F0E81946587 for ; Thu, 30 Mar 2023 13:38:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7053D2166B35; Thu, 30 Mar 2023 13:38:28 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1A5D2166B34 for ; Thu, 30 Mar 2023 13:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183518; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MWwWE1LrMKtsYoUVkyf0fUfWeY94FjfQpjDsQixqgAs=; b=fmtpojdFPRvXv6ej80OUh2XkeDKipBR9RFdvwFFb66GUbC9lDL5M5mQAApM7v4koL0Qmh/ yXSXXHWwzXplhat1vCQe9TLFmSUHc/U3BS85esYjehpQQUPbtYo+XvzI4r9hwTOXPNpI4M m8OysfPjjPhngmCS+xEYzDMbwl6LuBw= X-MC-Unique: uAM9-XyHMXegp-75KxgbcA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/31] qemu: capabilities: Drop 'kvmVersion' field Date: Thu, 30 Mar 2023 15:37:55 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183519889100001 Content-Type: text/plain; charset="utf-8" It's never set to any real value. Remove it along with the caching code. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 17 ----------------- src/qemu/qemu_capabilities.h | 1 - .../qemucapabilitiesdata/caps_4.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_4.2.0_ppc64.xml | 1 - tests/qemucapabilitiesdata/caps_4.2.0_s390x.xml | 1 - .../qemucapabilitiesdata/caps_4.2.0_x86_64.xml | 1 - .../qemucapabilitiesdata/caps_5.0.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_5.0.0_ppc64.xml | 1 - .../qemucapabilitiesdata/caps_5.0.0_riscv64.xml | 1 - .../qemucapabilitiesdata/caps_5.0.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.1.0_sparc.xml | 1 - .../qemucapabilitiesdata/caps_5.1.0_x86_64.xml | 1 - .../qemucapabilitiesdata/caps_5.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0_ppc64.xml | 1 - .../qemucapabilitiesdata/caps_5.2.0_riscv64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0_s390x.xml | 1 - .../qemucapabilitiesdata/caps_5.2.0_x86_64.xml | 1 - .../qemucapabilitiesdata/caps_6.0.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_6.0.0_s390x.xml | 1 - .../qemucapabilitiesdata/caps_6.0.0_x86_64.xml | 1 - .../qemucapabilitiesdata/caps_6.1.0_x86_64.xml | 1 - .../qemucapabilitiesdata/caps_6.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml | 1 - .../qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 1 - .../caps_7.0.0_aarch64+hvf.xml | 1 - .../qemucapabilitiesdata/caps_7.0.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml | 1 - .../qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 1 - .../qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 - .../caps_7.2.0_x86_64+hvf.xml | 1 - .../qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 - .../qemucapabilitiesdata/caps_8.0.0_riscv64.xml | 1 - .../qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 - 35 files changed, 51 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f37a81bfe7..6355c80f30 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -760,7 +760,6 @@ struct _virQEMUCaps { virBitmap *flags; unsigned int version; - unsigned int kvmVersion; unsigned int libvirtVersion; unsigned int microcodeVersion; char *hostCPUSignature; @@ -1992,7 +1991,6 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) ret->flags =3D virBitmapNewCopy(qemuCaps->flags); ret->version =3D qemuCaps->version; - ret->kvmVersion =3D qemuCaps->kvmVersion; ret->microcodeVersion =3D qemuCaps->microcodeVersion; ret->hostCPUSignature =3D g_strdup(qemuCaps->hostCPUSignature); @@ -2145,12 +2143,6 @@ unsigned int virQEMUCapsGetVersion(virQEMUCaps *qemu= Caps) } -unsigned int virQEMUCapsGetKVMVersion(virQEMUCaps *qemuCaps) -{ - return qemuCaps->kvmVersion; -} - - const char *virQEMUCapsGetPackage(virQEMUCaps *qemuCaps) { return qemuCaps->package; @@ -4706,12 +4698,6 @@ virQEMUCapsLoadCache(virArch hostArch, return -1; } - if (virXPathUInt("string(./kvmVersion)", ctxt, &qemuCaps->kvmVersion) = < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing version in QEMU capabilities cache")); - return -1; - } - if (virXPathUInt("string(./microcodeVersion)", ctxt, &qemuCaps->microcodeVersion) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -5049,9 +5035,6 @@ virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) virBufferAsprintf(&buf, "%d\n", qemuCaps->version); - virBufferAsprintf(&buf, "%d\n", - qemuCaps->kvmVersion); - virBufferAsprintf(&buf, "%u\n", qemuCaps->microcodeVersion); virBufferEscapeString(&buf, "%s\n= ", diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 15f0df5317..4881f41253 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -704,7 +704,6 @@ virArch virQEMUCapsGetArch(virQEMUCaps *qemuCaps); unsigned int virQEMUCapsGetVersion(virQEMUCaps *qemuCaps); const char *virQEMUCapsGetPackage(virQEMUCaps *qemuCaps); -unsigned int virQEMUCapsGetKVMVersion(virQEMUCaps *qemuCaps); int virQEMUCapsAddCPUDefinitions(virQEMUCaps *qemuCaps, virDomainVirtType type, const char **name, diff --git a/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml b/tests/qemu= capabilitiesdata/caps_4.2.0_aarch64.xml index e0cc16e730..f87962a379 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml @@ -112,7 +112,6 @@ 4002000 - 0 61700242 v4.1.0-2221-g36609b4fa3 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_4.2.0_ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0_ppc64.xml index de9c102caa..1cc145cf58 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0_ppc64.xml @@ -118,7 +118,6 @@ 4002000 - 0 42900242 v4.1.0-2198-g9e583f2 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_4.2.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0_s390x.xml index 08d0993ba3..b440d9d538 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0_s390x.xml @@ -76,7 +76,6 @@ 4002000 - 0 39100242 qemu-4.2.0-20200115.0.1e4aa2da.fc31 s390x diff --git a/tests/qemucapabilitiesdata/caps_4.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0_x86_64.xml index e36983da58..b45d4a6293 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0_x86_64.xml @@ -154,7 +154,6 @@ 4002000 - 0 43100242 v4.2.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml b/tests/qemu= capabilitiesdata/caps_5.0.0_aarch64.xml index 52529690c3..09619133c4 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml @@ -124,7 +124,6 @@ 5000000 - 0 61700241 v5.0.0 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0_ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.0.0_ppc64.xml index 9e1147e302..3b49aee40a 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0_ppc64.xml @@ -133,7 +133,6 @@ 5000000 - 0 42900241 v5.0.0 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml b/tests/qemu= capabilitiesdata/caps_5.0.0_riscv64.xml index f306bc83cd..fb460c9300 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml @@ -119,7 +119,6 @@ 5000000 - 0 0 v5.0.0 riscv64 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.0.0_x86_64.xml index 89a083dda8..5331cf0113 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0_x86_64.xml @@ -163,7 +163,6 @@ 5000000 - 0 43100241 v5.0.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_5.1.0_sparc.xml b/tests/qemuca= pabilitiesdata/caps_5.1.0_sparc.xml index 68728321eb..bc5b3e6fac 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0_sparc.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0_sparc.xml @@ -48,7 +48,6 @@ 5001000 - 0 0 qemu-5.1.0-5.fc33 sparc diff --git a/tests/qemucapabilitiesdata/caps_5.1.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.1.0_x86_64.xml index f02e843248..1c3d3ea2a9 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0_x86_64.xml @@ -167,7 +167,6 @@ 5001000 - 0 43100242 v5.1.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml b/tests/qemu= capabilitiesdata/caps_5.2.0_aarch64.xml index 8657478d86..effcf4e96a 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml @@ -131,7 +131,6 @@ 5002000 - 0 61700243 v5.2.0 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.2.0_ppc64.xml index 9a571817c6..d02441420d 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_ppc64.xml @@ -138,7 +138,6 @@ 5002000 - 0 42900243 v5.2.0 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml b/tests/qemu= capabilitiesdata/caps_5.2.0_riscv64.xml index ff3a4a7168..fe4757a12e 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml @@ -124,7 +124,6 @@ 5002000 - 0 0 v5.2.0 riscv64 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_5.2.0_s390x.xml index 3ec0bd4c32..38a3f70a5e 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_s390x.xml @@ -87,7 +87,6 @@ 5002000 - 0 39100243 qemu-5.2.0-20201215.0.ba93e22c.fc32 s390x diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.2.0_x86_64.xml index 293447644e..654fec58fe 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml @@ -171,7 +171,6 @@ 5002000 - 0 43100243 v5.2.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml b/tests/qemu= capabilitiesdata/caps_6.0.0_aarch64.xml index a71b955266..651cdc8095 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml @@ -141,7 +141,6 @@ 6000000 - 0 61700242 v6.0.0 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_6.0.0_s390x.xml index 89420c1e9b..a63263e7e5 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0_s390x.xml @@ -96,7 +96,6 @@ 6000000 - 0 39100242 qemu-6.0.0-20210517.1.4ff77070.fc33 s390x diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.0.0_x86_64.xml index fc6a3ffd4a..b1bf3caecf 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml @@ -182,7 +182,6 @@ 6000000 - 0 43100242 v6.0.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.1.0_x86_64.xml index da8478cefa..13d909e382 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml @@ -188,7 +188,6 @@ 6001000 - 0 43100243 v6.1.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml b/tests/qemu= capabilitiesdata/caps_6.2.0_aarch64.xml index ca7ab8bbc7..fd3d1602a1 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml @@ -154,7 +154,6 @@ 6001050 - 0 61700244 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml b/tests/qemuca= pabilitiesdata/caps_6.2.0_ppc64.xml index 7759599e67..97ebca47eb 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml @@ -151,7 +151,6 @@ 6002000 - 0 42900244 v6.2.0 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.2.0_x86_64.xml index db33c30341..e1758396b0 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml @@ -190,7 +190,6 @@ 6002000 - 0 43100244 v6.2.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml b/tests/= qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml index 836932b95d..2e8495dcdd 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml @@ -162,7 +162,6 @@ 6002092 - 0 61700243 v7.0.0-rc2 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml b/tests/qemu= capabilitiesdata/caps_7.0.0_aarch64.xml index fd428a8afd..1420cc844d 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml @@ -162,7 +162,6 @@ 6002092 - 0 61700243 v7.0.0-rc2 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml b/tests/qemuca= pabilitiesdata/caps_7.0.0_ppc64.xml index f4d161b7b4..a00ed4ef68 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml @@ -169,7 +169,6 @@ 7000000 - 0 42900243 v7.0.0 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_7.0.0_x86_64.xml index 1487630078..b7446435a6 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml @@ -196,7 +196,6 @@ 7000000 - 0 43100243 v7.0.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml b/tests/qemuca= pabilitiesdata/caps_7.1.0_ppc64.xml index e7fd3efca6..ccae1b1d2b 100644 --- a/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml @@ -169,7 +169,6 @@ 7001000 - 0 42900244 v7.1.0 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_7.1.0_x86_64.xml index 17b2286a68..6492695705 100644 --- a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml @@ -199,7 +199,6 @@ 7001000 - 0 43100244 v7.1.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml b/tests/qemucapa= bilitiesdata/caps_7.2.0_ppc.xml index 717debd9b1..f190be552a 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml @@ -157,7 +157,6 @@ 7002000 - 0 0 qemu-7.2.0-6.fc37 ppc diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml b/tests/q= emucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml index 941823892c..c08a99e734 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml @@ -203,7 +203,6 @@ 7002000 - 0 43100245 v7.2.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_7.2.0_x86_64.xml index 6a4ac5dcfa..37933c0848 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml @@ -203,7 +203,6 @@ 7002000 - 0 43100245 v7.2.0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml b/tests/qemu= capabilitiesdata/caps_8.0.0_riscv64.xml index a75e80120d..361c5fb811 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml @@ -144,7 +144,6 @@ 7002050 - 0 0 v7.2.0-333-g222059a0fc riscv64 diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_8.0.0_x86_64.xml index 74128be904..73924e1163 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml @@ -207,7 +207,6 @@ 7002050 - 0 43100244 v7.2.0-2146-g2946e1af27 x86_64 --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183536; cv=none; d=zohomail.com; s=zohoarc; b=CqnA+1FJ91KKdAA8Ca+9RjjPg5ESl8dwSJkHAxCeoJbPs7qc3rvA8HH6lQ3RYFhzJRUn5dLKMbEvbFL7Tj+GCnjtm84I0Y4ZvWWXkcsZ6xgrN0sTxMFSTTbvja5BGf/NyyxbEnPczj8LidH0e/p7Miyd4pbxCVAwJAvr924ph1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183536; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pc67wpC4P5qAnXzbca8KOAKBg2tj8atxHqpr5sYittw=; b=aX1Me9XUyDeMUWQCFoSLPpzDuyT/sZtX0wXt51sjr63kh5YEI2ioeCfR1TehAeSEGxLWabbWn4Enj7FSZuE5fMnkZu0+C8/qaGcgbpl7+T0Sp5XPb9TC3fQnPrXwPLiGnDhRIgMMCV1AamuZfKzMp3qy/oWYA3N9bjb/57JkGH4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183536913233.15134814985265; Thu, 30 Mar 2023 06:38:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-pXU_vGqiM6KH21pU501pNQ-1; Thu, 30 Mar 2023 09:38:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCDE4101A550; Thu, 30 Mar 2023 13:38:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8ECEC15BA0; Thu, 30 Mar 2023 13:38:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0846B1946A44; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6FA92194658F for ; Thu, 30 Mar 2023 13:38:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6231F2166B34; Thu, 30 Mar 2023 13:38:29 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC8DF2166B33 for ; Thu, 30 Mar 2023 13:38:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183535; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Pc67wpC4P5qAnXzbca8KOAKBg2tj8atxHqpr5sYittw=; b=EseuUHYTAAckYkXgVVNG4jvAwq++qiHDgHoK/clSNjOxavZT+5MQSqGAPBdseHgWZgbqCB efXB2cz6N0C5asazsZ6JFt8c2nZ2Y4mvb7KTzhTngUu5y009Dt70xZ1s7I4PziFhBTJdPq WeLQpKtRlMTe24zxo5rJY2MtitLPmdM= X-MC-Unique: pXU_vGqiM6KH21pU501pNQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/31] libxlCapsInitGuests: Rework insane use of ternary operators Date: Thu, 30 Mar 2023 15:37:56 +0200 Message-Id: <0e92a0597a2e3a73d9c311b794746fcf272235c3.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183537846100001 Content-Type: text/plain; charset="utf-8" Get rid of nested ternaries by adding a few helper variables and more explicit if conditions to fill them appropriately. Note that 'virCapabilitiesAllocMachines' doesn't require return value check any more as it can't fail. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/libxl/libxl_capabilities.c | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index c2975d637e..82c38d1b26 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -463,26 +463,32 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCaps *caps) for (i =3D 0; i < nr_guest_archs; ++i) { virCapsGuest *guest; - char const *const xen_machines[] =3D { - guest_archs[i].hvm ? "xenfv" : - (guest_archs[i].pvh ? "xenpvh" : "xenpv")}; virCapsGuestMachine **machines; + virDomainOSType ostype =3D VIR_DOMAIN_OSTYPE_XEN; + const char *loader =3D NULL; - if ((machines =3D virCapabilitiesAllocMachines(xen_machines, 1)) = =3D=3D NULL) - return -1; + if (guest_archs[i].hvm) { + char const *const xen_machines[] =3D { "xenfv", NULL }; + + ostype =3D VIR_DOMAIN_OSTYPE_HVM; + loader =3D LIBXL_FIRMWARE_DIR "/hvmloader"; + + machines =3D virCapabilitiesAllocMachines(xen_machines, 1); + } else if (guest_archs[i].pvh) { + char const *const xen_machines[] =3D { "xenpvh", NULL }; + + ostype =3D VIR_DOMAIN_OSTYPE_XENPVH; + machines =3D virCapabilitiesAllocMachines(xen_machines, 1); + } else { + char const *const xen_machines[] =3D { "xenpv", NULL }; + + ostype =3D VIR_DOMAIN_OSTYPE_XEN; + machines =3D virCapabilitiesAllocMachines(xen_machines, 1); + } - guest =3D virCapabilitiesAddGuest(caps, - guest_archs[i].hvm ? VIR_DOMAIN_OS= TYPE_HVM : - (guest_archs[i].pvh ? VIR_DOMAIN_O= STYPE_XENPVH : - VIR_DOMAIN_OSTYPE_XEN), - guest_archs[i].arch, + guest =3D virCapabilitiesAddGuest(caps, ostype, guest_archs[i].arc= h, LIBXL_EXECBIN_DIR "/qemu-system-i3= 86", - (guest_archs[i].hvm ? - LIBXL_FIRMWARE_DIR "/hvmloader" : - NULL), - 1, - machines); - machines =3D NULL; + loader, 1, machines); virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL, NULL, 0, NULL); --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183607; cv=none; d=zohomail.com; s=zohoarc; b=KxQktmup2RnaNsUlOnUjUU5TrM1B1R/fZzcjmvxC53acaiGd31P6xX4GFps+L9V8SecEbX7vyD5djrpKyS7co0xdAUXiTRZgDGv6aE4ZNHOyKLSvVhlQCUL0oz7I9I8TRvBPW+HqPMQ2x+IcpIpiXZcGwaG5qNjdzIAdGEAPC0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183607; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g+4EdXvbpheWNy1nYAFd7qaDfOWtx7fzD3Md2WW1vTA=; b=Wn+HKkxJgJQePHodi+trAoiQbW11xUjG9E8jS2lGCMIzvwgdG6WEglaw8bwyZO9hsV2/RNWhCeyW3xTHP4sp2ufOmUH2KzSACW0zVpbqVirI5PS45+L9ku5TXoaSf/k22NtJNC+hA8TXAZ96IFg5FE1+zVvq+F7DJnmisSJEoaM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183607738879.2384935277166; Thu, 30 Mar 2023 06:40:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-34-cYmJwcpaNbS8Ed3msOxEkw-1; Thu, 30 Mar 2023 09:39:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96CC4801210; Thu, 30 Mar 2023 13:39:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8536B1121330; Thu, 30 Mar 2023 13:39:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 03B4B19465BB; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 625B61946587 for ; Thu, 30 Mar 2023 13:38:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4F4152166B34; Thu, 30 Mar 2023 13:38:30 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE23F2166B33 for ; Thu, 30 Mar 2023 13:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183606; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g+4EdXvbpheWNy1nYAFd7qaDfOWtx7fzD3Md2WW1vTA=; b=EkizelhZtnMP2GIcHpVRm3wq4kC0pt+jZT3NBa4L0It8dErF8Ua4POfDzNTU06eBHkIulp iVWmOflD4TVDH7VbZaGnCxtziSUHrFJFKVkaG+95U8iNRfQjEpW4b5klcL/IXvGA0bZmcD AfFUJTZzquQfu2hgVrJLBbM/+Umfshs= X-MC-Unique: cYmJwcpaNbS8Ed3msOxEkw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/31] virCapabilitiesAllocMachines: Use NULL-terminated list as argument and return count Date: Thu, 30 Mar 2023 15:37:57 +0200 Message-Id: <7c9c06d336f5d51c13ef0b35894191e1907da915.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183608402100001 Content-Type: text/plain; charset="utf-8" Simplify use of the function by determining the number of elements inside the function. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/capabilities.c | 12 +++++++----- src/conf/capabilities.h | 2 +- src/libxl/libxl_capabilities.c | 9 +++++---- tests/testutilsqemu.c | 23 +++-------------------- tests/testutilsxen.c | 26 +++++++------------------- 5 files changed, 23 insertions(+), 49 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 9144ced498..6d2f6e282d 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -380,21 +380,23 @@ virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps, /** * virCapabilitiesAllocMachines: - * @machines: machine variants for emulator ('pc', or 'isapc', etc) - * @nmachines: number of machine variants for emulator + * @machines: NULL-terminated list of machine variants for emulator ('pc',= or 'isapc', etc) + * @nmachines: filled with number of machine variants for emulator * * Allocate a table of virCapsGuestMachine *from the supplied table * of machine names. */ virCapsGuestMachine ** -virCapabilitiesAllocMachines(const char *const *names, int nnames) +virCapabilitiesAllocMachines(const char *const *names, + int *nnames) { virCapsGuestMachine **machines; size_t i; - machines =3D g_new0(virCapsGuestMachine *, nnames); + *nnames =3D g_strv_length((gchar **)names); + machines =3D g_new0(virCapsGuestMachine *, *nnames); - for (i =3D 0; i < nnames; i++) { + for (i =3D 0; i < *nnames; i++) { machines[i] =3D g_new0(virCapsGuestMachine, 1); machines[i]->name =3D g_strdup(names[i]); } diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index ef6e8ab685..07f7a3ef58 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -261,7 +261,7 @@ virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps, virCapsGuestMachine ** virCapabilitiesAllocMachines(const char *const *names, - int nnames); + int *nnames); void virCapabilitiesFreeMachines(virCapsGuestMachine **machines, int nmachines); diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 82c38d1b26..2f4bc8bde8 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -464,6 +464,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCaps *caps) for (i =3D 0; i < nr_guest_archs; ++i) { virCapsGuest *guest; virCapsGuestMachine **machines; + int nmachines; virDomainOSType ostype =3D VIR_DOMAIN_OSTYPE_XEN; const char *loader =3D NULL; @@ -473,22 +474,22 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCaps *caps) ostype =3D VIR_DOMAIN_OSTYPE_HVM; loader =3D LIBXL_FIRMWARE_DIR "/hvmloader"; - machines =3D virCapabilitiesAllocMachines(xen_machines, 1); + machines =3D virCapabilitiesAllocMachines(xen_machines, &nmach= ines); } else if (guest_archs[i].pvh) { char const *const xen_machines[] =3D { "xenpvh", NULL }; ostype =3D VIR_DOMAIN_OSTYPE_XENPVH; - machines =3D virCapabilitiesAllocMachines(xen_machines, 1); + machines =3D virCapabilitiesAllocMachines(xen_machines, &nmach= ines); } else { char const *const xen_machines[] =3D { "xenpv", NULL }; ostype =3D VIR_DOMAIN_OSTYPE_XEN; - machines =3D virCapabilitiesAllocMachines(xen_machines, 1); + machines =3D virCapabilitiesAllocMachines(xen_machines, &nmach= ines); } guest =3D virCapabilitiesAddGuest(caps, ostype, guest_archs[i].arc= h, LIBXL_EXECBIN_DIR "/qemu-system-i3= 86", - loader, 1, machines); + loader, nmachines, machines); virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL, NULL, 0, NULL); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index d5922f302d..f6d49bc193 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -158,7 +158,7 @@ static int testQemuAddGuest(virCaps *caps, virArch arch) { - size_t nmachines; + int nmachines; virCapsGuestMachine **machines =3D NULL; virCapsGuest *guest; virArch emu_arch =3D arch; @@ -169,19 +169,11 @@ testQemuAddGuest(virCaps *caps, if (qemu_emulators[emu_arch] =3D=3D NULL) return 0; - nmachines =3D g_strv_length((gchar **)qemu_machines[emu_arch]); - machines =3D virCapabilitiesAllocMachines(qemu_machines[emu_arch], - nmachines); - if (machines =3D=3D NULL) - goto error; - + machines =3D virCapabilitiesAllocMachines(qemu_machines[emu_arch], &nm= achines); guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, arch, qemu_emulators[emu_arch], NULL, nmachines, machines); - machines =3D NULL; - nmachines =3D 0; - if (arch =3D=3D VIR_ARCH_I686 || arch =3D=3D VIR_ARCH_X86_64) virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_= CPUSELECTION); @@ -189,21 +181,12 @@ testQemuAddGuest(virCaps *caps, virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL); - nmachines =3D g_strv_length((char **)qemu_machines[emu_arch]); - machines =3D virCapabilitiesAllocMachines(qemu_machines[emu_arch], - nmachines); - if (machines =3D=3D NULL) - goto error; - + machines =3D virCapabilitiesAllocMachines(qemu_machines[emu_arch], &nm= achines); virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, qemu_emulators[emu_arch], NULL, nmachines, machines); return 0; - - error: - virCapabilitiesFreeMachines(machines, nmachines); - return -1; } diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index 821ee49d94..3484cccbf2 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -16,13 +16,13 @@ testXLInitCaps(void) virCapsGuestMachine **machines; int nmachines; static const char *const x86_machines[] =3D { - "xenfv" + "xenfv", NULL, }; static const char *const xen_machines[] =3D { - "xenpv", + "xenpv", NULL, }; static const char *const pvh_machines[] =3D { - "xenpvh", + "xenpvh", NULL, }; if ((caps =3D virCapabilitiesNew(virArchFromHost(), @@ -31,48 +31,36 @@ testXLInitCaps(void) caps->host.cpu =3D virCPUDefCopy(&cpuDefaultData); - nmachines =3D G_N_ELEMENTS(x86_machines); - if ((machines =3D virCapabilitiesAllocMachines(x86_machines, nmachines= )) =3D=3D NULL) - goto cleanup; + machines =3D virCapabilitiesAllocMachines(x86_machines, &nmachines); guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, "/usr/lib/xen/bin/qemu-system-i386", "/usr/lib/xen/boot/hvmloader", nmachines, machines); - machines =3D NULL; + virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL, NULL, 0, NULL); - nmachines =3D G_N_ELEMENTS(xen_machines); - if ((machines =3D virCapabilitiesAllocMachines(xen_machines, nmachines= )) =3D=3D NULL) - goto cleanup; + machines =3D virCapabilitiesAllocMachines(xen_machines, &nmachines); guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XEN, VIR_ARCH_X86_64, "/usr/lib/xen/bin/qemu-system-i386", NULL, nmachines, machines); - machines =3D NULL; virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL, NULL, 0, NULL); - nmachines =3D G_N_ELEMENTS(pvh_machines); - if ((machines =3D virCapabilitiesAllocMachines(pvh_machines, nmachines= )) =3D=3D NULL) - goto cleanup; + machines =3D virCapabilitiesAllocMachines(pvh_machines, &nmachines); guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XENPVH, VIR_ARCH_X86_64, "/usr/lib/xen/bin/qemu-system-i386", NULL, nmachines, machines); - machines =3D NULL; virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL, NULL, 0, NULL); return g_steal_pointer(&caps); - - cleanup: - virCapabilitiesFreeMachines(machines, nmachines); - return NULL; } --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183545; cv=none; d=zohomail.com; s=zohoarc; b=fJkKPEOz5DcisCtceae2OK+yyV5yw2/CjpOm1XfInI90dhW6Vh5+PtnkwZzpQBzITo2qhxQdHVg946GsQckuxiB7CjjCH+mKJMblZYH9n+YqyVLCFvJ0hylEkFdNY01Zp3Q1Qr9SMWBFR5NMMOZFuEzma/aUzmHWP/Dy1k/ql00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183545; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6ewI0gX0XVxzBMviKE4vUXkfQzVJ3/NoU4YeoZfJJ7c=; b=TT7EPSvNAfHi74kXdDnoJlv0wSk7um0QYhRKeOXU/iM/GvUH2bbEvr7+PKDatIbPrXldkEFO8oBkpvMC++Ap2dhoSGTiFqUAni1n+CQ6wQ/LaOES4UNeFvKyFjCPUCzkpxo+TuuJq5JyYcoIul6OO+FIb8Ju9ikM4yo3nMfiQoM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183545166617.3167165310653; Thu, 30 Mar 2023 06:39:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-FUsZ3XpsPxWEgey-rH2q-A-1; Thu, 30 Mar 2023 09:39:00 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C34A185A791; Thu, 30 Mar 2023 13:38:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28B6640BC797; Thu, 30 Mar 2023 13:38:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5513A1946A63; Thu, 30 Mar 2023 13:38:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6B38F19465B2 for ; Thu, 30 Mar 2023 13:38:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4FE512166B35; Thu, 30 Mar 2023 13:38:31 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B00F72166B33 for ; Thu, 30 Mar 2023 13:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183544; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6ewI0gX0XVxzBMviKE4vUXkfQzVJ3/NoU4YeoZfJJ7c=; b=bHHxLZwTBB2FVlUYEAp6DYuOyi1fq08rhMpteqe1C+v2fOGFqoc9wXV0uwHp5HG4cIBQe8 IYgnQuhm0yPIVrKIQuuq3ixn9lTE9BCW9YpfH+zv/kOBN0ME6Nkf77/bOGI68AP6radofe eBdX1tcPIKP9STx6apFDwDbLhl/+D/A= X-MC-Unique: FUsZ3XpsPxWEgey-rH2q-A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/31] virQEMUCapsGetMachineTypesCaps: Remove return value Date: Thu, 30 Mar 2023 15:37:58 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183545834100001 Content-Type: text/plain; charset="utf-8" The function always returns 0. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6355c80f30..0201f288b3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1015,7 +1015,7 @@ virQEMUCapsInitGuest(virCaps *caps, } -static int +static void virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps, size_t *nmachines, virCapsGuestMachine ***machines) @@ -1037,7 +1037,7 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps, *nmachines =3D accel->nmachineTypes; if (*nmachines =3D=3D 0) - return 0; + return; array =3D g_ptr_array_sized_new(*nmachines); @@ -1093,8 +1093,6 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps, *machines =3D g_new0(virCapsGuestMachine *, array->len); for (i =3D 0; i < array->len; ++i) (*machines)[i] =3D g_ptr_array_index(array, i); - - return 0; } @@ -1112,8 +1110,7 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, if (!binary) return 0; - if (virQEMUCapsGetMachineTypesCaps(qemuCaps, &nmachines, &machines) < = 0) - goto cleanup; + virQEMUCapsGetMachineTypesCaps(qemuCaps, &nmachines, &machines); /* We register kvm as the base emulator too, since we can * just give -no-kvm to disable acceleration if required */ @@ -1160,8 +1157,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, ret =3D 0; - cleanup: - virCapabilitiesFreeMachines(machines, nmachines); return ret; --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183548; cv=none; d=zohomail.com; s=zohoarc; b=Z+gO5ceiR9DepacN1tEzPlrzwO1ct7k46SU1ssHGQjAQGzBCtxfNKC6mCWIDWz53BbGOFfxnMVNjRtyeEth5hT+wiTvoC0tBTapXG8lFQBegWBU4RQd0Fp+X0ukXyJFUpJ7KDRRTFWgv47m8mgVbOSk8P6vBq9QBenPX33Vu3lY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183548; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xCaw8hImLSlCUTUrmrgQiZvHM3bWeH+Vx4Dy+R8F0i4=; b=d6BK3Xi/sTLGJ97kAN5PVam/mk7pgzryBZh2KSORSTwSHTiyZ/VyalcSI9pIvDJUwyKY0Io6eoSQneYMmtLK3FoJ8+xEu7eVouH33jUbpYeJ4fUPxJtoQvuz3J4bvm9H4TwsJ3AjHFjFwABeSeCXTC4MBTD5wMv3H0sWuqnz0zg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 168018354882622.068974890434788; Thu, 30 Mar 2023 06:39:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-uE1tz9_7P_GjCPlRWdJPqA-1; Thu, 30 Mar 2023 09:39:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34F9D3814943; Thu, 30 Mar 2023 13:39:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21EA240BC798; Thu, 30 Mar 2023 13:39:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9880C1946A7F; Thu, 30 Mar 2023 13:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 57B391946A63 for ; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 468C22166B33; Thu, 30 Mar 2023 13:38:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD2002166B35 for ; Thu, 30 Mar 2023 13:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183547; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xCaw8hImLSlCUTUrmrgQiZvHM3bWeH+Vx4Dy+R8F0i4=; b=IFQJsmpikjNjLAweqbBUj9gwrCUeLUlERGWzBYPkVfk48OExdPQqcj+BKl1XhNbm09p9GL xmi0c1p+imThl9ZaD4qVmDKhYhs2bw5vHKt4zcaknvUDkYkj3gXl6JdxhIxBPBhY/yQlU5 CaXoCz5O0cyJjcDguaNtD+I++k83sIU= X-MC-Unique: uE1tz9_7P_GjCPlRWdJPqA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/31] virQEMUCapsInitGuestFromBinary: Refactor cleanup Date: Thu, 30 Mar 2023 15:37:59 +0200 Message-Id: <6540069a26cbc553bdc93cc218947a37cc05d584.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183549852100004 Content-Type: text/plain; charset="utf-8" Remove useless call to virCapabilitiesFreeMachines as the pointers were cleared and the unneeded 'ret' variable. Since we don't need to clear the 'machines' pointer now, remove that as well. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0201f288b3..135455df63 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1105,7 +1105,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapsGuest *guest; virCapsGuestMachine **machines =3D NULL; size_t nmachines =3D 0; - int ret =3D -1; if (!binary) return 0; @@ -1118,9 +1117,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, guestarch, binary, NULL, nmachines, machines); - machines =3D NULL; - nmachines =3D 0; - /* CPU selection is always available, because all QEMU versions * we support can use at least '-cpu host' */ virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_CPUS= ELECTION); @@ -1155,11 +1151,7 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_= NONPAE); } - ret =3D 0; - - virCapabilitiesFreeMachines(machines, nmachines); - - return ret; + return 0; } --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183560; cv=none; d=zohomail.com; s=zohoarc; b=RJ29c6IVfAaADLp4XEgceomo4iz0PxsCQz9QpHMP2+YFNJAnvv0ZM/xVykXN96ECkc8++oUICz+qwjUZlZd4NFwD5OSc2tZEBdJL03V4iN6aVN4geicmMaX9mIXc2SG5GtzNkU8SgZeDRzJsFUGXIEgyeKSq+nV4/uGvjtVcN8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183560; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vIyStmU/ZqndUzUg8zTFbfYSmTz48OH6CLoTbURF4YA=; b=WbORJuVgouOeV25eiy6mv3AJpR1rwxk0Cosvm1f6AEAm8Vfp3u06cTKu7EPG3bmLC+dwWIUSZWplTGvnnNVBiJAIjtnq9KCR/eoEQx03BGef9UWZZihM5obPxTDnad5s8HxGDsu5JXM9+X+m6DP+HLe4RkPoeiHmRXBe40YfmNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183560696987.6519540401185; Thu, 30 Mar 2023 06:39:20 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-358-oSpmZDhZNe2GGJN0rzs-ZA-1; Thu, 30 Mar 2023 09:39:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE2A129ABA18; Thu, 30 Mar 2023 13:39:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99CC2C15BB8; Thu, 30 Mar 2023 13:39:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B4615194658F; Thu, 30 Mar 2023 13:38:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 44F8D1946587 for ; Thu, 30 Mar 2023 13:38:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 363F22166B36; Thu, 30 Mar 2023 13:38:33 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC83D2166B35 for ; Thu, 30 Mar 2023 13:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183559; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vIyStmU/ZqndUzUg8zTFbfYSmTz48OH6CLoTbURF4YA=; b=VWYREjz+PUOjd3S4IJuQzG+GaTj1DltlNDzcVk5WbZpPogIaDKbHtQcZltXzaLmsadcGSz eBQHkcGRMaeI1ydciFdr81myf0WPE57VIubxTmnF+qCt5iUbBLtRIN5+R67Vl/JsUTlBOH W6SBDoxf+ueOHBpXVqYaQIOnHIaIPCM= X-MC-Unique: oSpmZDhZNe2GGJN0rzs-ZA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/31] virQEMUCapsInitGuestFromBinary: Remove return value Date: Thu, 30 Mar 2023 15:38:00 +0200 Message-Id: <800cfe1337dde8e05f161421ec74646ff8610fbe.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183561961100001 Content-Type: text/plain; charset="utf-8" The function always returns 0. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 11 ++++------- src/qemu/qemu_capabilities.h | 8 ++++---- tests/qemucaps2xmltest.c | 8 +------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 135455df63..72105a65a3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1004,9 +1004,8 @@ virQEMUCapsInitGuest(virCaps *caps, } } - ret =3D virQEMUCapsInitGuestFromBinary(caps, - binary, qemuCaps, - guestarch); + virQEMUCapsInitGuestFromBinary(caps, binary, qemuCaps, guestarch); + ret =3D 0; VIR_FREE(binary); virObjectUnref(qemuCaps); @@ -1096,7 +1095,7 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps, } -int +void virQEMUCapsInitGuestFromBinary(virCaps *caps, const char *binary, virQEMUCaps *qemuCaps, @@ -1107,7 +1106,7 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, size_t nmachines =3D 0; if (!binary) - return 0; + return; virQEMUCapsGetMachineTypesCaps(qemuCaps, &nmachines, &machines); @@ -1150,8 +1149,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_= PAE); virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_= NONPAE); } - - return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 4881f41253..ca31e26f0d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -819,10 +819,10 @@ bool virQEMUCapsSupportsGICVersion(virQEMUCaps *qemuC= aps, const char *virQEMUCapsGetPreferredMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType); -int virQEMUCapsInitGuestFromBinary(virCaps *caps, - const char *binary, - virQEMUCaps *qemuCaps, - virArch guestarch); +void virQEMUCapsInitGuestFromBinary(virCaps *caps, + const char *binary, + virQEMUCaps *qemuCaps, + virArch guestarch); int virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virArch hostarch, diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 2c5cb1b68b..192fb48450 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -102,13 +102,7 @@ testGetCaps(char *capsData, const testQemuData *data) return NULL; } - if (virQEMUCapsInitGuestFromBinary(caps, - binary, - qemuCaps, - arch) < 0) { - fprintf(stderr, "failed to create the capabilities from qemu"); - return NULL; - } + virQEMUCapsInitGuestFromBinary(caps, binary, qemuCaps, arch); return g_steal_pointer(&caps); } --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183540; cv=none; d=zohomail.com; s=zohoarc; b=Xp3KwKlrJuu4vcpY2+hbQOqeKrj3BHKAbeAG2GNs3LMEmlOdSx6vxf1Ktmnhh7ZV90pXsP9+NciNEi88dsvYq/vgbrU8QXmp1rQBweU2cHCk3Re72QCS3DI+hit2qmM5IC6oAbUMDNIsJNjL39rUAkBVVatTzxBw9cwp7w3VjOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183540; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yGp901Z/pn8caNGMaeNG6JpJwcd6yyf5ANE+IaEVoM0=; b=LL3uOSdiuf3SSBvbbfpXMJoq9TseMGpEer1t2LbnQjrWXlW/GzjMvQ+/Jh6zciKkspNsGS25CPM9Av2oHrRv4m/Dfb3nrMvxjWiwXfYyrjGmqbps/Wwp2Gcj4G/4xoOwuAFTKA8SrL/mvNxwO0nZ8tPZfPu5GwHoxc/q0wB390c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183540783824.9620076095041; Thu, 30 Mar 2023 06:39:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-Rx8GxbR7MhumSqyHeyW3Rg-1; Thu, 30 Mar 2023 09:38:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E05CE1991C44; Thu, 30 Mar 2023 13:38:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4F1740BC79B; Thu, 30 Mar 2023 13:38:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1328C19465B9; Thu, 30 Mar 2023 13:38:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2C60B1946597 for ; Thu, 30 Mar 2023 13:38:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 287BF2166B36; Thu, 30 Mar 2023 13:38:34 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94EC72166B35 for ; Thu, 30 Mar 2023 13:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183538; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yGp901Z/pn8caNGMaeNG6JpJwcd6yyf5ANE+IaEVoM0=; b=b5ma+oDVi8HpmwmFPb/FyvxCTE9v8Yqf+25CVXalSseqnO5KHaVnKWBNArD1Lk72/kdsKh WkKoNXWz1CyprsmNGwDs4cugLeaGIDNEH+SvKnZI7eYlTMpkRaxvgr4YjoQeCLSe2ufq69 9Z2GwlpfO08nedA6HLsmD3zbgDf1blQ= X-MC-Unique: Rx8GxbR7MhumSqyHeyW3Rg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/31] virQEMUCapsInitGuest: Refactor cleanup and remove return value Date: Thu, 30 Mar 2023 15:38:01 +0200 Message-Id: <509b56450459f265e8929fa7295d0e80951b527d.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183541884100001 Content-Type: text/plain; charset="utf-8" Use automatic pointer freeing, remove 'ret' variable and also remove return value completely. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 72105a65a3..93915a9284 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -984,15 +984,14 @@ virQEMUCapsGetDefaultEmulator(virArch hostarch, } -static int +static void virQEMUCapsInitGuest(virCaps *caps, virFileCache *cache, virArch hostarch, virArch guestarch) { - char *binary =3D NULL; - virQEMUCaps *qemuCaps =3D NULL; - int ret =3D -1; + g_autofree char *binary =3D NULL; + g_autoptr(virQEMUCaps) qemuCaps =3D NULL; binary =3D virQEMUCapsGetDefaultEmulator(hostarch, guestarch); @@ -1000,17 +999,10 @@ virQEMUCapsInitGuest(virCaps *caps, if (binary) { if (!(qemuCaps =3D virQEMUCapsCacheLookup(cache, binary))) { virResetLastError(); - VIR_FREE(binary); } } virQEMUCapsInitGuestFromBinary(caps, binary, qemuCaps, guestarch); - ret =3D 0; - - VIR_FREE(binary); - virObjectUnref(qemuCaps); - - return ret; } @@ -1194,10 +1186,7 @@ virQEMUCapsInit(virFileCache *cache) * if a qemu-system-$ARCH binary can't be found */ for (i =3D 0; i < VIR_ARCH_LAST; i++) - if (virQEMUCapsInitGuest(caps, cache, - hostarch, - i) < 0) - return NULL; + virQEMUCapsInitGuest(caps, cache, hostarch, i); return g_steal_pointer(&caps); } --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183549; cv=none; d=zohomail.com; s=zohoarc; b=jCOlZAFyVWL4zKTDpYW+KBKfYT9Z0VirrHt/rtDQAoXfPYIz9V76CZOjTkdg9pURrseXkzV4N+Pc0h1XxZS0AtqavHBJpPP98V/DI4+/Xawvx7tbJcB5telPXIJVSw2llnOQojRgTXe4EXS61oiZQHRYyGBQq3+cj/c3Mmf8VT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183549; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7+6TF56iBIb01I8PlS6nRY4XVVjkrnK2k6NZJXY/IKU=; b=Xtp/COb/yrIjWR3X0GzMRr2rhfKhMNuIirZ5lOAc3VDTaE9mtUH2ooUbeps+qUy0dn624TaAiZ/PpW61MEy/mwJT8SwZnoWCAbAqJtUxGxQglesWWLuJdEU+dkJ6s6Da8nixw3BEgIjGJ0m1d/VGA1aDeo4Yi3Risr/O6BwrM4Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183549508399.7121281632848; Thu, 30 Mar 2023 06:39:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-571-xAMhukOpNCyMdckFTwELlg-1; Thu, 30 Mar 2023 09:38:43 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2E47B381494C; Thu, 30 Mar 2023 13:38:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 185A9C15BA0; Thu, 30 Mar 2023 13:38:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C91CE194658F; Thu, 30 Mar 2023 13:38:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2AA731946587 for ; Thu, 30 Mar 2023 13:38:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 26BA52166B37; Thu, 30 Mar 2023 13:38:35 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B5802166B35 for ; Thu, 30 Mar 2023 13:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183548; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7+6TF56iBIb01I8PlS6nRY4XVVjkrnK2k6NZJXY/IKU=; b=XSu8+Egmva0+aHbk/7V29IPXb27xao+yR1ovYqTpdnybukngi6unPlRpqIC2NA2eIAl9Jr DVuPu83sP79mxkDhQ5MoLh5UmY141N2+Z3NEYpV/5EzesZdFzU/Gc3fiOgZlXEgbMTOiKl 4Ydvo9Z/XBD7KPgCCmKdsw+Dol5VyM8= X-MC-Unique: xAMhukOpNCyMdckFTwELlg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/31] virCapabilitiesFreeMachines: Remove unused function Date: Thu, 30 Mar 2023 15:38:02 +0200 Message-Id: <7b7ad30f92c241fc52d9aa055c70bf792776f13a.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183549848100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/capabilities.c | 19 ------------------- src/conf/capabilities.h | 3 --- src/libvirt_private.syms | 1 - 3 files changed, 23 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 6d2f6e282d..c1d5d6cd6e 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -404,25 +404,6 @@ virCapabilitiesAllocMachines(const char *const *names, return machines; } -/** - * virCapabilitiesFreeMachines: - * @machines: table of vircapsGuestMachinePtr - * - * Free a table of virCapsGuestMachine * - */ -void -virCapabilitiesFreeMachines(virCapsGuestMachine **machines, - int nmachines) -{ - size_t i; - if (!machines) - return; - for (i =3D 0; i < nmachines && machines[i]; i++) { - g_clear_pointer(&machines[i], virCapabilitiesFreeGuestMachine); - } - g_free(machines); -} - /** * virCapabilitiesAddGuest: * @caps: capabilities to extend diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 07f7a3ef58..c78e3e52fa 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -262,9 +262,6 @@ virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps, virCapsGuestMachine ** virCapabilitiesAllocMachines(const char *const *names, int *nnames); -void -virCapabilitiesFreeMachines(virCapsGuestMachine **machines, - int nmachines); void virCapabilitiesFreeGuest(virCapsGuest *guest); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 87c3bab64f..37fc6d8b5c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -64,7 +64,6 @@ virCapabilitiesDomainDataLookup; virCapabilitiesDomainSupported; virCapabilitiesFormatXML; virCapabilitiesFreeGuest; -virCapabilitiesFreeMachines; virCapabilitiesGetNodeInfo; virCapabilitiesHostInitIOMMU; virCapabilitiesHostNUMAAddCell; --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183590; cv=none; d=zohomail.com; s=zohoarc; b=hcYiMgciFtsagQ1J9Df68upH47tbTMicomFLqAv7UmmYGTqVRCk4fq6zSXiNSk+ahIJf4ve+a8P04+E3xNGnxQNshvvn2QImDRN0x1sGuPDGIhhGrkzgTFA2bIHv05XQBTPuIrvtnPFmff0AZ2tPsw2mc3HXsVj3XzVUZMk59SQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183590; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=n0lPAp5xfC6s890DQdxc1TfjdorINhujACcjWDJpSU8=; b=DZEafxKYK2v12lxKobX0PKU+AZTp9jgMyGiOLiNEREpMiMLe7KWYcOJOH1AuV/lVf2pUrZnipLi+T/ylndhk5sM8EQjaSUUDSd3ZBzzr0Ly4ICiuDYk0CBAa8hCEsr5L4lr7qgM6hB9IdxqImbnrZCu5A7RedYNhd0wD8s5NbsI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183590970627.4200916104189; Thu, 30 Mar 2023 06:39:50 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-416-pDn1bAAHNPeQCvu3OZD1fA-1; Thu, 30 Mar 2023 09:39:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D1D6100F907; Thu, 30 Mar 2023 13:39:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 567E418EC7; Thu, 30 Mar 2023 13:39:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5775219472DF; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 284491946A4C for ; Thu, 30 Mar 2023 13:38:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 245862166B35; Thu, 30 Mar 2023 13:38:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9359B2166B34 for ; Thu, 30 Mar 2023 13:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183589; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=n0lPAp5xfC6s890DQdxc1TfjdorINhujACcjWDJpSU8=; b=R+tojxIQJD6oHy7DGGoTsCNodifazeYlRiheJc6Sxj/8pKEtNGzVUl6D2COcYFUvy5CeWP yvCeVXC+X11poy8+YV6xIixmoO1NMrKcB5ycMfSc6ZfyVn2vZBbwXEYKHOeYAG6fBZGzw6 S1ULvBbbGt9yRlGIVMGsVlNWAskC+S8= X-MC-Unique: pDn1bAAHNPeQCvu3OZD1fA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/31] vircapstest: Remove 'qemu' testing Date: Thu, 30 Mar 2023 15:38:03 +0200 Message-Id: <3c5eb6c7365d92bc707b58e48a44407b168e52d4.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183592290100001 Content-Type: text/plain; charset="utf-8" We have testing based on real capabilities in 'qemucaps2xmltest' for qemu guest related data and 'vircaps2xmltest' tests the host data gathering. The testing done here makes no sense. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/vircapstest.c | 74 --------------------------------------------- 1 file changed, 74 deletions(-) diff --git a/tests/vircapstest.c b/tests/vircapstest.c index be93325307..30e56ccc20 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -21,7 +21,6 @@ #include "testutils.h" #include "testutilslxc.h" -#include "testutilsqemu.h" #include "capabilities.h" #include "virbitmap.h" @@ -51,25 +50,6 @@ test_virCapabilitiesGetCpusForNodemask(const void *data = G_GNUC_UNUSED) } -static bool G_GNUC_UNUSED -doCapsExpectFailure(virCaps *caps, - int ostype, - virArch arch, - int domaintype, - const char *emulator, - const char *machinetype) -{ - virCapsDomainData *data =3D virCapabilitiesDomainDataLookup(caps, osty= pe, - arch, domaintype, emulator, machinetype); - - if (data) { - VIR_FREE(data); - return false; - } - - return true; -} - static bool G_GNUC_UNUSED doCapsCompare(virCaps *caps, int ostype, @@ -135,55 +115,6 @@ doCapsCompare(virCaps *caps, if (!doCapsCompare(caps, o, a, d, e, m, fo, fa, fd, fe, fm)) \ ret =3D -1; -#define CAPS_EXPECT_ERR(o, a, d, e, m) \ - if (!doCapsExpectFailure(caps, o, a, d, e, m)) \ - ret =3D -1; - -#ifdef WITH_QEMU -static int -test_virCapsDomainDataLookupQEMU(const void *data G_GNUC_UNUSED) -{ - int ret =3D 0; - g_autoptr(virCaps) caps =3D NULL; - - if (!(caps =3D testQemuCapsInit())) - return -1; - - /* Checking each parameter individually */ - CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, NULL, NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-x86_64", "pc"); - CAPSCOMP(VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, N= ULL, NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-x86_64", "pc"); - CAPSCOMP(-1, VIR_ARCH_AARCH64, VIR_DOMAIN_VIRT_NONE, NULL, NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_AARCH64, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-aarch64", "virt"); - CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_KVM, NULL, NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_KVM, "/usr/bin/qemu-system-x86_64", "pc"); - CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, "/usr/bin/qemu-syste= m-ppc64", NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_PPC64, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-ppc64", "pseries"); - - CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, NULL, "pseries", - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_PPC64, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-ppc64", "pseries"); - CAPSCOMP(-1, VIR_ARCH_PPC64LE, VIR_DOMAIN_VIRT_NONE, NULL, "pseries", - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_PPC64LE, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-ppc64", "pseries"); - - CAPS_EXPECT_ERR(VIR_DOMAIN_OSTYPE_LINUX, VIR_ARCH_NONE, VIR_DOMAIN_VIR= T_NONE, NULL, NULL); - CAPS_EXPECT_ERR(-1, VIR_ARCH_PPC64LE, VIR_DOMAIN_VIRT_NONE, NULL, "pc"= ); - CAPS_EXPECT_ERR(-1, VIR_ARCH_MIPS, VIR_DOMAIN_VIRT_NONE, NULL, NULL); - CAPS_EXPECT_ERR(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, - "/usr/bin/qemu-system-aarch64", "pc"); - CAPS_EXPECT_ERR(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_VMWARE, NULL, "pc"); - - return ret; -} -#endif /* WITH_QEMU */ - #ifdef WITH_LXC static int test_virCapsDomainDataLookupLXC(const void *data G_GNUC_UNUSED) @@ -213,11 +144,6 @@ mymain(void) if (virTestRun("virCapabilitiesGetCpusForNodemask", test_virCapabilitiesGetCpusForNodemask, NULL) < 0) ret =3D -1; -#ifdef WITH_QEMU - if (virTestRun("virCapsDomainDataLookupQEMU", - test_virCapsDomainDataLookupQEMU, NULL) < 0) - ret =3D -1; -#endif #ifdef WITH_LXC if (virTestRun("virCapsDomainDataLookupLXC", test_virCapsDomainDataLookupLXC, NULL) < 0) --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183546; cv=none; d=zohomail.com; s=zohoarc; b=fdAKCQIlE1V/+pjrYhKGAIwn47vKk801Y9Qd/kRs5HesMi0fHcWNASYjxAwL79Zac5v7WTwS+/RqWXTUWPoSOiVrj1Y7AtB5BLqMqncIHoqxdba3tKsCdj7OpPne2SGtRyvHSg34Rhws2tea1fyxM+VetB/TKI/q5VYY/4SOD54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183546; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AmuSQXb50lyii4rOFidR6iaN+ldbZN/0GBD9ZQV7jTY=; b=lrdhuuCR6yySEvm2tR412iL88u+z7VLYfPF3sJjygHEW7bI7mjLoKxyTYPRyMnr7ENBgej4+9di3w8B5mn26Vw2APOcj7O1DdlTuKxMrgbarN4BIlt1Db7Z2rJMbBhZmE0EJy8NPMdXA/cM+41ax8xiPIiEQ4V5DunmbZuG81Vo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183546613821.3177412026981; Thu, 30 Mar 2023 06:39:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-383-bp7LqWn7OgO-xsZ0g_uYkw-1; Thu, 30 Mar 2023 09:39:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A187E1C0755A; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EFEC40BC797; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5FBB519465A4; Thu, 30 Mar 2023 13:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 25BDE1946A61 for ; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 21EDD2166B36; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 850562166B35 for ; Thu, 30 Mar 2023 13:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183545; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AmuSQXb50lyii4rOFidR6iaN+ldbZN/0GBD9ZQV7jTY=; b=O4Z/EFkLpIL/lq/Fhk29iz9rJGWcaAPJHV1NNmN729KDx2/+r7tgWxk9Y4FUr7VkdG2NYT d51V/1s86gRgkzvao3Bojv7T4/im7ZhNb7IuLddo+6BiLysxoQBO1ptqxJcwSbrx7Kz3mm xSnJ86N5D7ws0MIg9RBtckEGDPKRF3M= X-MC-Unique: bp7LqWn7OgO-xsZ0g_uYkw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/31] tests: vircaps: Remove pointless testing of virCapabilitiesHostNUMAGetCpus Date: Thu, 30 Mar 2023 15:38:04 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183548016100001 Content-Type: text/plain; charset="utf-8" The test case doesn't validate the returned map of cpus, just checks that it didn't fail. We test the returned value indirectly via qemuxml2argvtest. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/vircapstest.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/tests/vircapstest.c b/tests/vircapstest.c index 30e56ccc20..2101d35198 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -22,34 +22,11 @@ #include "testutils.h" #include "testutilslxc.h" #include "capabilities.h" -#include "virbitmap.h" #define VIR_FROM_THIS VIR_FROM_NONE -static int -test_virCapabilitiesGetCpusForNodemask(const void *data G_GNUC_UNUSED) -{ - const char *nodestr =3D "3,4,5,6"; - g_autoptr(virBitmap) nodemask =3D NULL; - g_autoptr(virBitmap) cpumap =3D NULL; - g_autoptr(virCapsHostNUMA) caps =3D NULL; - int mask_size =3D 8; - - if (!(caps =3D virTestCapsBuildNUMATopology(3))) - return -1; - - if (virBitmapParse(nodestr, &nodemask, mask_size) < 0) - return -1; - - if (!(cpumap =3D virCapabilitiesHostNUMAGetCpus(caps, nodemask))) - return -1; - - return 0; -} - - static bool G_GNUC_UNUSED doCapsCompare(virCaps *caps, int ostype, @@ -141,9 +118,6 @@ mymain(void) { int ret =3D 0; - if (virTestRun("virCapabilitiesGetCpusForNodemask", - test_virCapabilitiesGetCpusForNodemask, NULL) < 0) - ret =3D -1; #ifdef WITH_LXC if (virTestRun("virCapsDomainDataLookupLXC", test_virCapsDomainDataLookupLXC, NULL) < 0) --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183678; cv=none; d=zohomail.com; s=zohoarc; b=IaozYuOacD7uG8VixIt6/lq0veaBfIOjaW89VwfzdubuCnIY6uR60OMdALzznD8MY9t3FMVrrIvxOxfAFGEi4hqjZ9Fn4CN6cWApKqulW7cM90WQslDsI2pIoin5iBqV0Z/EJFMlO3vg0YNIrN6Csf0rD8qGDWkN9xT63rirLEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183678; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hNUPJ2fcOtG/Ffp7Tdv5zvPL9QYEwXPNtc4IIUaAhHE=; b=Hg8o07QyMrJlg5PY1vU2NVIOAh1Fqk+SYSZKRcNx0TqVl3mHy7wI/mAs7WLtSaJg92mhKrx3+HOhvbWSBSFdHrFqylbU/DkxEiYbcN3YfAWd1zF+vG82wS+XXavvVJDJZrWcSZ1DEtpsvxzmA1POdpar+zFQbAqrTDH+vXe6wXA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183678702837.6547033463252; Thu, 30 Mar 2023 06:41:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-90-Ufp-PrBJOECB0vWFzKkREg-1; Thu, 30 Mar 2023 09:41:15 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E6AC03C0F1A9; Thu, 30 Mar 2023 13:41:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D38E84042AC0; Thu, 30 Mar 2023 13:41:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2654219465B7; Thu, 30 Mar 2023 13:39:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 30C9619472C0 for ; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1A0AB2166B36; Thu, 30 Mar 2023 13:38:38 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 824462166B33 for ; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183677; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hNUPJ2fcOtG/Ffp7Tdv5zvPL9QYEwXPNtc4IIUaAhHE=; b=KlvZF7whTKj7Cdp1NRK1pQCg6vy45LRno/Ap4buYMvC+GaeUNUAGLLXmd4xnyepodHSwfj 7BZ1MZ2/24GbO/t3BOXdE0xJLJT7QcbT1ph5wXhGLGGLd9IejJm5dNQ65LT+hVjl2Za45d QDvliDGHPpa9SPYjiJFRf2+LhR0BjQk= X-MC-Unique: Ufp-PrBJOECB0vWFzKkREg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/31] tests: Remove 'vircapstest' Date: Thu, 30 Mar 2023 15:38:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183935983100003 Content-Type: text/plain; charset="utf-8" Technically for the LXC capabilities lookup we don't have another test case, but given that it shares the implementation with qemu and thus the only thing we are missing out on is testing of filling of the fake capabilities which doesn't make sense testing. Remove vircapstest. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/meson.build | 14 ----- tests/vircapstest.c | 130 -------------------------------------------- 2 files changed, 144 deletions(-) delete mode 100644 tests/vircapstest.c diff --git a/tests/meson.build b/tests/meson.build index 6be806f4ae..11010ebc6c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -249,19 +249,6 @@ if conf.has('WITH_QEMU') domaincapstest_link_whole +=3D [ test_utils_qemu_lib ] endif -vircapstest_link_with =3D [] -vircapstest_link_whole =3D [] -vircapstest_sources =3D [ 'vircapstest.c' ] -if conf.has('WITH_LXC') - vircapstest_link_with +=3D [ lxc_driver_impl_lib ] - vircapstest_link_whole +=3D [ test_utils_lxc_lib ] -endif -if conf.has('WITH_QEMU') - vircapstest_link_with +=3D [ qemu_driver_impl ] - vircapstest_link_whole +=3D [ test_utils_qemu_lib ] - vircapstest_sources +=3D [ qemu_dtrace_gen_objects ] -endif - tests +=3D [ { 'name': 'commandtest' }, { 'name': 'cputest', 'link_with': cputest_link_with, 'link_whole': cpute= st_link_whole }, @@ -285,7 +272,6 @@ tests +=3D [ { 'name': 'virauthconfigtest' }, { 'name': 'virbitmaptest' }, { 'name': 'virbuftest' }, - { 'name': 'vircapstest', 'sources': vircapstest_sources, 'link_with': vi= rcapstest_link_with, 'link_whole': vircapstest_link_whole }, { 'name': 'vircgrouptest' }, { 'name': 'virconftest' }, { 'name': 'vircryptotest' }, diff --git a/tests/vircapstest.c b/tests/vircapstest.c deleted file mode 100644 index 2101d35198..0000000000 --- a/tests/vircapstest.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) IBM Corp 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - * - */ - -#include - -#include "testutils.h" -#include "testutilslxc.h" -#include "capabilities.h" - - -#define VIR_FROM_THIS VIR_FROM_NONE - - -static bool G_GNUC_UNUSED -doCapsCompare(virCaps *caps, - int ostype, - virArch arch, - int domaintype, - const char *emulator, - const char *machinetype, - int expect_ostype, - virArch expect_arch, - int expect_domaintype, - const char *expect_emulator, - const char *expect_machinetype) -{ - bool ret =3D false; - virCapsDomainData *data =3D virCapabilitiesDomainDataLookup(caps, osty= pe, - arch, domaintype, emulator, machinetype); - - if (!data) - goto error; - - if (data->ostype !=3D expect_ostype) { - fprintf(stderr, "data->ostype=3D%s doesn't match expect_ostype=3D%= s\n", - virDomainOSTypeToString(data->ostype), - virDomainOSTypeToString(expect_ostype)); - goto error; - } - - if (data->arch !=3D expect_arch) { - fprintf(stderr, "data->arch=3D%s doesn't match expect_arch=3D%s\n", - virArchToString(data->arch), - virArchToString(expect_arch)); - goto error; - } - - if (data->domaintype !=3D expect_domaintype) { - fprintf(stderr, "data->domaintype=3D%s doesn't match " - "expect_domaintype=3D%s\n", - virDomainVirtTypeToString(data->domaintype), - virDomainVirtTypeToString(expect_domaintype)); - goto error; - } - - if (STRNEQ(data->emulator, expect_emulator)) { - fprintf(stderr, "data->emulator=3D%s doesn't match expect_emulator= =3D%s\n", - data->emulator, expect_emulator); - goto error; - } - - if (STRNEQ_NULLABLE(data->machinetype, expect_machinetype)) { - fprintf(stderr, "data->machinetype=3D%s doesn't match " - "expect_machinetype=3D%s\n", - NULLSTR(data->machinetype), NULLSTR(expect_machinetype)); - goto error; - } - - ret =3D true; - error: - VIR_FREE(data); - return ret; -} - -#define CAPSCOMP(o, a, d, e, m, fo, fa, fd, fe, fm) \ - if (!doCapsCompare(caps, o, a, d, e, m, fo, fa, fd, fe, fm)) \ - ret =3D -1; - -#ifdef WITH_LXC -static int -test_virCapsDomainDataLookupLXC(const void *data G_GNUC_UNUSED) -{ - int ret =3D 0; - g_autoptr(virCaps) caps =3D NULL; - - if (!(caps =3D testLXCCapsInit())) - return -1; - - CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, NULL, NULL, - VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_LXC, "/usr/libexec/libvirt_lxc", NULL); - CAPSCOMP(-1, VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_NONE, NULL, NULL, - VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_LXC, "/usr/libexec/libvirt_lxc", NULL); - - return ret; -} -#endif /* WITH_LXC */ - -static int -mymain(void) -{ - int ret =3D 0; - -#ifdef WITH_LXC - if (virTestRun("virCapsDomainDataLookupLXC", - test_virCapsDomainDataLookupLXC, NULL) < 0) - ret =3D -1; -#endif /* WITH_LXC */ - - return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIR_TEST_MAIN(mymain) --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183668; cv=none; d=zohomail.com; s=zohoarc; b=XG1gO6csg6+qGi9djA7oIxNCMahPAhlYZZc0yOPBBxh6N1FNrRbAbGxGgpcGSrjHMoYq4sYL+PGoxqbicHgNrWox8c+MyeXS1+pIdUtZ8RS1pjTV5wbefp+eB7aghvRJTyNo+j299KmVNczjYY/3ssmRcCFFAyYHThIphe3ecTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183668; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6FRkER1ogpRTnlP0bO4zgpypDEA6HLyZeY7Krv178WQ=; b=Lwhybt8+tInPw1ZehCYcUw1vJnGZBwVaAH4H/JmvyKnN9i8Pw4N70U6zMLLg+3LfF5naDOPt9xCfxdiWIC/s62X0o1pcNrM1E/6XSOzDzPmIxJNLErK+HhNBXfMnLkeuEz95bOvzyGMqmL0RzUFGv8gvWoqaF8ei+K1LnjwDF5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183668384148.61288474791024; Thu, 30 Mar 2023 06:41:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-pObXlNMzOEy1BIM3Rd0pcA-1; Thu, 30 Mar 2023 09:40:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69A78101A550; Thu, 30 Mar 2023 13:40:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 578701121330; Thu, 30 Mar 2023 13:40:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A19A919465A4; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 461B91946A41 for ; Thu, 30 Mar 2023 13:38:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2AC5F2166B34; Thu, 30 Mar 2023 13:38:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D6702166B35 for ; Thu, 30 Mar 2023 13:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183666; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6FRkER1ogpRTnlP0bO4zgpypDEA6HLyZeY7Krv178WQ=; b=aKnyTgVgyEng0+/oh2dnB4KUGpd2RfSVlQKAMJtVYReXluDF4sKxsYiWWr+7O6jud/oTfX 5ftcMU+HDT04q9AnApaRwPjP5SEI2jEn3ThwWViL9g4H6dWvjN/Atr34DQrWjmU7DIpx/o K2+sqJLB67YaTq/Sbflj4Wc+FTvSyTk= X-MC-Unique: pObXlNMzOEy1BIM3Rd0pcA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/31] testutilsqemu: Extract fetching of real virQEMUCaps into testQemuGetRealCaps Date: Thu, 30 Mar 2023 15:38:06 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183934844100001 Content-Type: text/plain; charset="utf-8" 'testQemuInfoInitArgs' contains the logic to fetch and use the capabilities for tests using 'struct testQemuInfo'. As in certain cases use of 'struct testQemuInfo' is an overkill extract the code to fetch the capabilities into a standalone helper. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/testutilsqemu.c | 117 +++++++++++++++++++++++++++--------------- tests/testutilsqemu.h | 8 +++ 2 files changed, 85 insertions(+), 40 deletions(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index f6d49bc193..a1c55170d9 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -902,10 +902,77 @@ testQemuInfoSetArgs(struct testQemuInfo *info, } +/** + * testQemuGetRealCaps: + * + * @arch: architecture to fetch caps for + * @version: qemu version to fetch caps for ("latest" for fetching the lat= est version from @capsLatestFiles) + * @variant: capabilities variant to fetch caps for + * @capsLatestFiles: hash table containing latest version of capabilities = for the @arch+@variant tuple + * @capsCache: hash table filled with the cache of capabilities + * @capsReplies: Filled with path to the corresponding '.replies' file + * + * Fetches and returns the appropriate virQEMUCaps for the @arch+@version+= @variant + * tuple. The returned pointer is a copy of the cached object and thus can + * be freely modified. Caller is responsible for freeing it. + */ +virQEMUCaps * +testQemuGetRealCaps(const char *arch, + const char *version, + const char *variant, + GHashTable *capsLatestFiles, + GHashTable *capsCache, + char **capsReplies) +{ + g_autofree char *capsfile =3D NULL; + bool stripmachinealiases =3D false; + virQEMUCaps *cachedcaps =3D NULL; + virQEMUCaps *ret =3D NULL; + + if (STREQ(version, "latest")) { + g_autofree char *archvariant =3D g_strdup_printf("%s%s", arch, var= iant); + struct testQemuCapsFile *f =3D g_hash_table_lookup(capsLatestFiles= , archvariant); + + if (!f) { + VIR_TEST_VERBOSE("'latest' caps for '%s' were not found\n", ar= ch); + return NULL; + } + + capsfile =3D g_strdup(f->path); + stripmachinealiases =3D true; + } else { + capsfile =3D g_strdup_printf("%s/caps_%s_%s%s.xml", + TEST_QEMU_CAPS_PATH, + version, arch, variant); + } + + if (!g_hash_table_lookup_extended(capsCache, capsfile, NULL, (void **)= &cachedcaps)) { + if (!(cachedcaps =3D qemuTestParseCapabilitiesArch(virArchFromStri= ng(arch), capsfile))) { + VIR_TEST_VERBOSE("Failed to parse qemu capabilities file '%s'"= , capsfile); + return NULL; + } + + g_hash_table_insert(capsCache, g_strdup(capsfile), cachedcaps); + } + + ret =3D virQEMUCapsNewCopy(cachedcaps); + + if (stripmachinealiases) + virQEMUCapsStripMachineAliases(ret); + + if (capsReplies) { + /* provide path to the replies file for schema testing */ + capsfile[strlen(capsfile) - 3] =3D '\0'; + *capsReplies =3D g_strdup_printf("%sreplies", capsfile); + } + + return ret; +} + + int testQemuInfoInitArgs(struct testQemuInfo *info) { - g_autofree char *capsfile =3D NULL; ssize_t cap; if (!info->args.newargs) @@ -927,47 +994,17 @@ testQemuInfoInitArgs(struct testQemuInfo *info) } if (info->args.capsarch && info->args.capsver) { - bool stripmachinealiases =3D false; - virQEMUCaps *cachedcaps =3D NULL; - info->arch =3D virArchFromString(info->args.capsarch); - - if (STREQ(info->args.capsver, "latest")) { - g_autofree char *archvariant =3D g_strdup_printf("%s%s", info-= >args.capsarch, info->args.capsvariant); - struct testQemuCapsFile *f =3D g_hash_table_lookup(info->conf-= >capslatest, archvariant); - - if (!f) { - fprintf(stderr, "'latest' caps for '%s' were not found\n",= info->args.capsarch); - return -1; - } - - capsfile =3D g_strdup(f->path); - stripmachinealiases =3D true; - } else { - capsfile =3D g_strdup_printf("%s/caps_%s_%s%s.xml", - TEST_QEMU_CAPS_PATH, - info->args.capsver, - info->args.capsarch, - info->args.capsvariant); - } - - if (!g_hash_table_lookup_extended(info->conf->capscache, capsfile,= NULL, (void **) &cachedcaps)) { - if (!(cachedcaps =3D qemuTestParseCapabilitiesArch(info->arch,= capsfile))) - return -1; - - g_hash_table_insert(info->conf->capscache, g_strdup(capsfile),= cachedcaps); - } - - info->qemuCaps =3D virQEMUCapsNewCopy(cachedcaps); - - if (stripmachinealiases) - virQEMUCapsStripMachineAliases(info->qemuCaps); - info->flags |=3D FLAG_REAL_CAPS; - - /* provide path to the replies file for schema testing */ - capsfile[strlen(capsfile) - 3] =3D '\0'; - info->schemafile =3D g_strdup_printf("%sreplies", capsfile); + info->qemuCaps =3D testQemuGetRealCaps(info->args.capsarch, + info->args.capsver, + info->args.capsvariant, + info->conf->capslatest, + info->conf->capscache, + &info->schemafile); + + if (!info->qemuCaps) + return -1; } else { info->qemuCaps =3D virQEMUCapsNew(); } diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 69cad61f5a..d7ee73beed 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -151,4 +151,12 @@ void testQemuInfoClear(struct testQemuInfo *info); int testQemuPrepareHostBackendChardevOne(virDomainDeviceDef *dev, virDomainChrSourceDef *chardev, void *opaque); + +virQEMUCaps * +testQemuGetRealCaps(const char *arch, + const char *version, + const char *variant, + GHashTable *capsLatestFiles, + GHashTable *capsCache, + char **capsReplies); #endif --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183689; cv=none; d=zohomail.com; s=zohoarc; b=WcXV8J6cRDd6CLit38TpFAN/dDnxnt8QKQL1h6Jw843f/V4oyFc355G2RTtvQf1vNTntQGATH7ysDSEGXIBvx8+x4k8zv8E6acs5dDbvcwxzwct8wxyDD30m8wpGrd0jgKsZQHzwoqW+LAU0yS+wkqduFbnqOjcxld/JTh0FsCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183689; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Qeh+1LzdNQyWg1my7zs0jmKZGpNfLP35TXf7ffl0lCM=; b=Q9wZeEhBjGmeWHyiX841QSvNHtwlgyZH99wrNmD59qYfH5rol274pU/MelFwQGOoQopHooRipYGEgiNRo07eXju0IwbG5VeeaTVFfzXTThUxOhcZsIbWY9t391ONiFd5lQtbqmQVya4E3/sucJqieT5nG2ggIZ9fIf7NmFyeQUQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183689719392.6032324279645; Thu, 30 Mar 2023 06:41:29 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-9FSoMWEyPpS4vqKrTSUKrA-1; Thu, 30 Mar 2023 09:41:25 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EBD6C3C0F1A3; Thu, 30 Mar 2023 13:41:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9641492B00; Thu, 30 Mar 2023 13:41:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 70AA51946A41; Thu, 30 Mar 2023 13:39:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 474FD19465B5 for ; Thu, 30 Mar 2023 13:38:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1C8862166B33; Thu, 30 Mar 2023 13:38:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 905312166B35 for ; Thu, 30 Mar 2023 13:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183688; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Qeh+1LzdNQyWg1my7zs0jmKZGpNfLP35TXf7ffl0lCM=; b=FvwXDhTu/xgol0XexZO1R1Gg9t7iHNmuaKzC+3d2JWHod21/pNgZG8MD63I1CN2u/FJ2V0 uE7Vc4+bhn0+hmF4atDXaQciE5FEQQNNIL0nBXjebvS2O/+92+RTUMwdU3Z7jr5GFGZ5t1 n+XKqpq8YKS0EhC9FS9HYz5a8+b1WuY= X-MC-Unique: 9FSoMWEyPpS4vqKrTSUKrA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/31] testQemuGetRealCaps: Integrate fetching of QMP schema Date: Thu, 30 Mar 2023 15:38:07 +0200 Message-Id: <5ac81b8cf409ad80ebf4dbba970570aa5cf19877.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183947689100001 Content-Type: text/plain; charset="utf-8" Move the lookup of the corresponding QMP schema used for validation of QMP commands from 'testCompareXMLToArgvValidateSchema' to testQemuGetRealCaps as an optional step. This will simplify using QMP command validation in other tests which will use testQemuGetRealCaps. 'testutilsqemuschema' module is now linked into 'test_utils_qemu' as it contains no monitor-specific code itself and after this patch it's referenced directly from that module. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/meson.build | 4 ++-- tests/qemuxml2argvtest.c | 22 ++-------------------- tests/testutilsqemu.c | 29 +++++++++++++++++++++-------- tests/testutilsqemu.h | 5 +++-- 4 files changed, 28 insertions(+), 32 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 11010ebc6c..8958e68a69 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -147,13 +147,13 @@ endif if conf.has('WITH_QEMU') test_utils_qemu_lib =3D static_library( 'test_utils_qemu', - [ 'testutilsqemu.c' ], + [ 'testutilsqemu.c', 'testutilsqemuschema.c' ], dependencies: [ tests_dep ], ) test_utils_qemu_monitor_lib =3D static_library( 'test_utils_qemu_monitor', - [ 'qemumonitortestutils.c', 'testutilsqemuschema.c' ], + [ 'qemumonitortestutils.c', ], dependencies: [ tests_dep ], ) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7f3b2985eb..e0d237bb2d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -549,32 +549,14 @@ testCompareXMLToArgvValidateSchema(virCommand *cmd, struct testQemuInfo *info) { g_auto(GStrv) args =3D NULL; - GHashTable *schema =3D NULL; - - /* comment out with line comment to enable schema checking for non _CA= PS tests - if (!info->schemafile) - info->schemafile =3D testQemuGetLatestCapsForArch(virArchToString= (info->arch), "replies"); - // */ - - if (info->schemafile) { - /* lookup and insert into cache if not found */ - if (!g_hash_table_lookup_extended(info->conf->qapiSchemaCache, - info->schemafile, - NULL, (void **) &schema)) { - schema =3D testQEMUSchemaLoad(info->schemafile); - g_hash_table_insert(info->conf->qapiSchemaCache, - g_strdup(info->schemafile), - schema); - } - } - if (!schema) + if (!info->qmpSchema) return 0; if (virCommandGetArgList(cmd, &args) < 0) return -1; - if (testCompareXMLToArgvValidateSchemaCommand(args, schema) < 0) + if (testCompareXMLToArgvValidateSchemaCommand(args, info->qmpSchema) <= 0) return -1; return 0; diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index a1c55170d9..0d7892353c 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -2,6 +2,7 @@ #ifdef WITH_QEMU # include "testutilsqemu.h" +# include "testutilsqemuschema.h" # include "testutilshostcpus.h" # include "testutils.h" # include "viralloc.h" @@ -910,11 +911,16 @@ testQemuInfoSetArgs(struct testQemuInfo *info, * @variant: capabilities variant to fetch caps for * @capsLatestFiles: hash table containing latest version of capabilities = for the @arch+@variant tuple * @capsCache: hash table filled with the cache of capabilities - * @capsReplies: Filled with path to the corresponding '.replies' file + * @schemaCache: hash table for caching QMP schemas (may be NULL, see belo= w) + * @schema: Filled with the QMP schema (hash table) (may be NULL, see belo= w) * * Fetches and returns the appropriate virQEMUCaps for the @arch+@version+= @variant * tuple. The returned pointer is a copy of the cached object and thus can * be freely modified. Caller is responsible for freeing it. + * + * If @schemaCache and @schema are non-NULL, @schema is filled with with a + * pointer (borrowed from the cache) to the hash table representing the QE= MU QMP + * schema used for validation of the monitor traffic. */ virQEMUCaps * testQemuGetRealCaps(const char *arch, @@ -922,7 +928,8 @@ testQemuGetRealCaps(const char *arch, const char *variant, GHashTable *capsLatestFiles, GHashTable *capsCache, - char **capsReplies) + GHashTable *schemaCache, + GHashTable **schema) { g_autofree char *capsfile =3D NULL; bool stripmachinealiases =3D false; @@ -960,10 +967,16 @@ testQemuGetRealCaps(const char *arch, if (stripmachinealiases) virQEMUCapsStripMachineAliases(ret); - if (capsReplies) { - /* provide path to the replies file for schema testing */ - capsfile[strlen(capsfile) - 3] =3D '\0'; - *capsReplies =3D g_strdup_printf("%sreplies", capsfile); + /* strip 'xml' suffix so that we can format the file to '.replies' */ + capsfile[strlen(capsfile) - 3] =3D '\0'; + + if (schemaCache && schema) { + g_autofree char *schemafile =3D g_strdup_printf("%sreplies", capsf= ile); + + if (!g_hash_table_lookup_extended(schemaCache, schemafile, NULL, (= void **) schema)) { + *schema =3D testQEMUSchemaLoad(schemafile); + g_hash_table_insert(schemaCache, g_strdup(schemafile), *schema= ); + } } return ret; @@ -1001,7 +1014,8 @@ testQemuInfoInitArgs(struct testQemuInfo *info) info->args.capsvariant, info->conf->capslatest, info->conf->capscache, - &info->schemafile); + info->conf->qapiSchemaCache, + &info->qmpSchema); if (!info->qemuCaps) return -1; @@ -1028,7 +1042,6 @@ testQemuInfoClear(struct testQemuInfo *info) { VIR_FREE(info->infile); VIR_FREE(info->outfile); - VIR_FREE(info->schemafile); VIR_FREE(info->errfile); virObjectUnref(info->qemuCaps); g_clear_pointer(&info->args.fakeCapsAdd, virBitmapFree); diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index d7ee73beed..1e6611daa3 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -99,7 +99,7 @@ struct testQemuInfo { unsigned int flags; unsigned int parseFlags; virArch arch; - char *schemafile; + GHashTable *qmpSchema; /* borrowed pointer from the cache */ struct testQemuArgs args; struct testQemuConf *conf; @@ -158,5 +158,6 @@ testQemuGetRealCaps(const char *arch, const char *variant, GHashTable *capsLatestFiles, GHashTable *capsCache, - char **capsReplies); + GHashTable *schemaCache, + GHashTable **schema); #endif --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183603; cv=none; d=zohomail.com; s=zohoarc; b=Vq2/SBIFE8+HFATIbKsdf4bMErVaxojx4V0jUKufZUFQUAcy1sRCWQxI7GVhKKtiQ3OayhSJUA0snQ/u2pFFhJPdmdbhLj3dNReBZ3fqrpd9PMQriK7RcSLfCI+E3N/js9AilBvqoyj1RSgtbohxl3R8eQbqk6ysy0YYk/olgM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183603; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3spqEqdde/J1M1rYUsLoR2JPxGTBYDYmHOzV3M0fXBk=; b=E4rpn4pFnQ1wkBx6CsJVXz/aZECfk/4ynmFSAD2Fq3L5N5PyrKV+HDt21uNzmC2l4nZOWmdbLCazVrG5aWj2qy19RF7CCaJ7a5DS/sQlXZ5veeECvTiGswJLmLpX/7oCc++mDE82LgZvvpuJqZEcejZOnDewtzqKFYIuszb6gzI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183603789900.4680615458559; Thu, 30 Mar 2023 06:40:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-Fpbd73VvMHKDRSSZ8pSFgQ-1; Thu, 30 Mar 2023 09:39:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FEF53814943; Thu, 30 Mar 2023 13:39:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CFE240BC797; Thu, 30 Mar 2023 13:39:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0BEFF1946A62; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 218E61946587 for ; Thu, 30 Mar 2023 13:38:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 07AFC2166B37; Thu, 30 Mar 2023 13:38:41 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C19B2166B35 for ; Thu, 30 Mar 2023 13:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183602; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3spqEqdde/J1M1rYUsLoR2JPxGTBYDYmHOzV3M0fXBk=; b=OhnXR7IHvNKNkvO1GKkle1kHd5puVlsJH1Wac9h5+9lHnwIr0KvYB6YmRzpJXAO6cdJ346 EI1F7GNGaAQQibcWS65GIsLuhbgZpcw/pfbh/w6nVcJuo84Ga1D7wfLEpN5E6XU2gURauW gMrq5JoWiKheib38vrj0dHPRiW/5LXc= X-MC-Unique: Fpbd73VvMHKDRSSZ8pSFgQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/31] qemumemlocktest: Use real capabilities Date: Thu, 30 Mar 2023 15:38:08 +0200 Message-Id: <893e5931c817ad2d311618f04b7f144985f39177.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183604376100001 Content-Type: text/plain; charset="utf-8" Use testQemuGetRealCaps to fetch real capabilities and use it in place of the faked caps. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemumemlocktest.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c index efed232407..61b73e1d79 100644 --- a/tests/qemumemlocktest.c +++ b/tests/qemumemlocktest.c @@ -45,8 +45,15 @@ testCompareMemLock(const void *data) static int mymain(void) { + g_autoptr(GHashTable) capslatest =3D testQemuGetLatestCaps(); + g_autoptr(GHashTable) capscache =3D virHashNew(virObjectUnref); + g_autoptr(virQEMUCaps) qemuCaps_x86_64 =3D NULL; + g_autoptr(virQEMUCaps) qemuCaps_ppc64 =3D NULL; int ret =3D 0; - g_autoptr(virQEMUCaps) qemuCaps =3D NULL; + + if (!(qemuCaps_x86_64 =3D testQemuGetRealCaps("x86_64", "latest", "", = capslatest, capscache, NULL, NULL)) || + !(qemuCaps_ppc64 =3D testQemuGetRealCaps("ppc64", "latest", "", c= apslatest, capscache, NULL, NULL))) + return EXIT_FAILURE; if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; @@ -78,18 +85,15 @@ mymain(void) qemuTestSetHostArch(&driver, VIR_ARCH_X86_64); - DO_TEST("pc-kvm", 0); - DO_TEST("pc-tcg", 0); - - qemuCaps =3D virQEMUCapsNew(); - - virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI); - - if (qemuTestCapsCacheInsert(driver.qemuCapsCache, qemuCaps) < 0) { + virFileCacheClear(driver.qemuCapsCache); + if (qemuTestCapsCacheInsert(driver.qemuCapsCache, qemuCaps_x86_64) < 0= ) { ret =3D -1; goto cleanup; }; + DO_TEST("pc-kvm", 0); + DO_TEST("pc-tcg", 0); + DO_TEST("pc-hardlimit", 2147483648); DO_TEST("pc-locked", VIR_DOMAIN_MEMORY_PARAM_UNLIMITED); DO_TEST("pc-hostdev", 2147483648); @@ -100,9 +104,8 @@ mymain(void) DO_TEST("pc-locked+hostdev", VIR_DOMAIN_MEMORY_PARAM_UNLIMITED); qemuTestSetHostArch(&driver, VIR_ARCH_PPC64); - - virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); - if (qemuTestCapsCacheInsert(driver.qemuCapsCache, qemuCaps) < 0) { + virFileCacheClear(driver.qemuCapsCache); + if (qemuTestCapsCacheInsert(driver.qemuCapsCache, qemuCaps_ppc64) < 0)= { ret =3D -1; goto cleanup; }; --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183646; cv=none; d=zohomail.com; s=zohoarc; b=b+N2Ky8EmQlfEpv0WlDJJsl+J/crKGadjINPAw3IoHl9+XeXrONo1AhdgatT4JWJbmyKsnwznAKTeh4Fw+6P5wNHV3UsgwVng447TcTkzH4+fzAIdWXYvlv/aBcJ6JWiApaH8QZ7kaBmMtCUWVktK7QKh17F+KOnMnKNgKACFnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183646; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AwDJFmSMVlgtY9pb46lr/dZ4l3dPGEVSPWQHgueVN3o=; b=B4lSeLqI74IHypYgObqZFiivTLdNhhs2mJPc1nobF6bSXAzcZxfqOtIcHSoMXjQZvo9DqZ5rcPx3HZTEtuscFNWLetsgyp446yeALMMeXLgiSAudUiLAjfWQ2+3uTv+mdwY7SefPb8KSQ3kG+WsyfCC5DewFC0oSqttmF1FOiTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183646006518.0462756218072; Thu, 30 Mar 2023 06:40:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-WJ7m_GaKNQe4ZZ2YVkuNvA-1; Thu, 30 Mar 2023 09:40:37 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 323C229ABA20; Thu, 30 Mar 2023 13:40:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E25C14171BF; Thu, 30 Mar 2023 13:40:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A8E7F19465B8; Thu, 30 Mar 2023 13:39:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 04A991946587 for ; Thu, 30 Mar 2023 13:38:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 003862166B37; Thu, 30 Mar 2023 13:38:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D50B2166B35 for ; Thu, 30 Mar 2023 13:38:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183644; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AwDJFmSMVlgtY9pb46lr/dZ4l3dPGEVSPWQHgueVN3o=; b=D1EtOFDen7yB7kiqzbf45+MQdSiFEzSpvnsGHsZirf+PPNv3stX78RaTWa4rx88H1+oH8y ulZoS0W7jVo/R4AcaZfNB6R7QziWsV6r1ZbY+ficH+QXYMi6wD54C79mGRFZZrrzuoHsne D5tFbI/shpj6UTZqCZGgvENqqZFbH5w= X-MC-Unique: WJ7m_GaKNQe4ZZ2YVkuNvA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 15/31] qemuhotplugtest: Don't fetch capabilities when they are not used Date: Thu, 30 Mar 2023 15:38:09 +0200 Message-Id: <764fc8a0106357729d19382525095c56a676e108.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183650082100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtest.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 6a36856d8a..804e32279d 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -319,7 +319,6 @@ testQemuHotplug(const void *data) unsigned int device_parse_flags =3D 0; virDomainObj *vm =3D NULL; virDomainDeviceDef *dev =3D NULL; - g_autoptr(virCaps) caps =3D NULL; g_autoptr(qemuMonitorTest) test_mon =3D NULL; qemuDomainObjPrivate *priv =3D NULL; @@ -339,9 +338,6 @@ testQemuHotplug(const void *data) virTestLoadFile(result_filename, &result_xml) < 0) goto cleanup; - if (!(caps =3D virQEMUDriverGetCapabilities(&driver, false))) - goto cleanup; - if (test->vm) { vm =3D test->vm; if (!vm->def) { @@ -480,7 +476,6 @@ testQemuHotplugCpuPrepare(const char *test, GHashTable *qmpschema) { qemuDomainObjPrivate *priv =3D NULL; - virCaps *caps =3D NULL; g_autofree char *prefix =3D NULL; struct testQemuHotplugCpuData *data =3D NULL; @@ -501,9 +496,6 @@ testQemuHotplugCpuPrepare(const char *test, if (qemuHotplugCreateObjects(driver.xmlopt, &data->vm, data->xml_dom) = < 0) goto error; - if (!(caps =3D virQEMUDriverGetCapabilities(&driver, false))) - goto error; - /* create vm->newDef */ data->vm->persistent =3D true; if (virDomainObjSetDefTransient(driver.xmlopt, data->vm, NULL) < 0) @@ -533,7 +525,6 @@ testQemuHotplugCpuPrepare(const char *test, return data; error: - virObjectUnref(caps); testQemuHotplugCpuDataFree(data); return NULL; } --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183653; cv=none; d=zohomail.com; s=zohoarc; b=l1Vj8xM+ggfbXBwlm/G5XG99BBlSEF9oisvPGAVituFTdtUjy0IwlHitPKLsaZCbs1FfJYrs9YGxqvtCTm2rm52iRKsoRD76vwobW1jRw+1t4QltQBk53bYYgpz0PuGD4DnDFgesCrp0254tmsgr2s6X5tABSd5Yv1+65DtjY9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183653; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/LOckEmnFvuG3wka//ryF0gP6FW/onURPkR8KnX69aY=; b=XA5C1myJalMScEJu0XRHTZ3mWERJm2l/QyjLEXP8cUBF+Ax0s7qWeWwFPIN4dZngigY/sGauJZmNEFAMtm4t2S5wHPgHILpsGWuMb7ogaOuIBU71FV4HZtxjoDI68AeZ7WFruHL2nJpHkSft7y15hY7kXCJBNIKXmVbm17/QrZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183653428134.37504233988022; Thu, 30 Mar 2023 06:40:53 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-500-zGcbkwgbMBKwBdxoyDNfEA-1; Thu, 30 Mar 2023 09:40:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68BCC88B7AA; Thu, 30 Mar 2023 13:40:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55E752027040; Thu, 30 Mar 2023 13:40:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DE75319472C1; Thu, 30 Mar 2023 13:39:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 287D11946A7D for ; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0AEB62166B37; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 603092166B35 for ; Thu, 30 Mar 2023 13:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183652; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/LOckEmnFvuG3wka//ryF0gP6FW/onURPkR8KnX69aY=; b=B9ufIHquNJb3OUtrkUQKWk2Ld3IVg+z6AnZTCtnCWzYpuXt/+BBf0QdicS3T6E7ZagSwMQ 9wqRk0ZgX1E9X8VV3I3zsl8e7PJbQEn5Xlcz0Z2oKAy7cROK+n+zWZMcxA9OPufdOIhhai wEDLjk0xzIRImx0l/Z0VOlLfIxgKgIk= X-MC-Unique: zGcbkwgbMBKwBdxoyDNfEA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/31] qemuhotplugtestdomain: Move all i686 test cases to x86_64 Date: Thu, 30 Mar 2023 15:38:10 +0200 Message-Id: <5455048e81b5942d0164ee431e0bba095fce4d78.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183696624100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml | 4 ++-- .../qemuhotplug-graphics-spice-listen-network.xml | 4 ++-- .../qemuhotplug-graphics-spice-timeout.xml | 4 ++-- tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml b/test= s/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml index ad77405266..3acf55ab17 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml @@ -5,7 +5,7 @@ 219100 1 - hvm + hvm @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-listen= -network.xml b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-list= en-network.xml index 2323521f5e..e88d1f26d3 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-listen-networ= k.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-listen-networ= k.xml @@ -5,7 +5,7 @@ 219136 1 - hvm + hvm @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeou= t.xml b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml index 0ca19e9610..0e96033fc8 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml @@ -5,7 +5,7 @@ 1048576 2 - hvm + hvm @@ -38,7 +38,7 @@ restart restart - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice.xml b/= tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice.xml index 657b6ccbed..ec761d6619 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice.xml @@ -5,7 +5,7 @@ 219136 1 - hvm + hvm @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183593; cv=none; d=zohomail.com; s=zohoarc; b=dSeWG4s/vL+udYsTbPO0cf/Iv5i4P+xGk4DEujCoZIHYH3oGuOYge2J4TgEvf546kaYb0BB95yqwzsRvvJhkP23BXo2wP1ZEcYIlQwlKqZzKSsyK+hFxgquxfrGv6Owqn7nveR7DRnvXfQ22YhWM/vvRtjapnz3D04vCKEJgc7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183593; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E2S2nzGVhXClbchpDf/N8agBgpprG/mv6t8VZBJqzok=; b=SDRVAHJEmpGKRhjSCF20uPJn1LjcN9pb9Ua0aME7Eylz/oFTqMv7R9nuUhjfcngHHyaAdJ+3T1stVxfA9rz8V9L0pkCgVzbcKJnR7bV8bhPwQXrX1f+l3vbb27IwmsnTjBqkMe5TafmJnKHQWwXlFwApI3fSZBtwk3mH6pxg2jQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183593340309.51289444134363; Thu, 30 Mar 2023 06:39:53 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-455-LamUfHOoNVq1iwcZy_SxSQ-1; Thu, 30 Mar 2023 09:39:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6CE201C0755F; Thu, 30 Mar 2023 13:39:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5649B18EC6; Thu, 30 Mar 2023 13:39:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5EA1419472E2; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E09A81946A4E for ; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DC41B2166B36; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F2152166B35 for ; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183592; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=E2S2nzGVhXClbchpDf/N8agBgpprG/mv6t8VZBJqzok=; b=Tw2TEDXdKm9JcMxkDQdNi807Zwm6mr0Jt1WiCl/cVpS0PrgANvINuHcdys1QTlqFY1IJcz cBbAK1r3LpDjdSuqSYSXMmC8aRdTFmtjEQaUcQJnx/+8mEmFw7qMifhj71ZdMCFDahQ/Vq GUs+/arKokxoeqUmj0cCmJo+d/h9Cos= X-MC-Unique: LamUfHOoNVq1iwcZy_SxSQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/31] qemuhotplugtest: Enable 'lsilogic' SCSI controller Date: Thu, 30 Mar 2023 15:38:11 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183594347100001 Content-Type: text/plain; charset="utf-8" All real qemus support the 'lsilogic' controller and thus would pick it as the default rather than virtio-scsi. Since lsilogic is limited in some aspects we should test it with the proper default model. In the future the fake capabilities will be replaced by real capabilities so this test would break. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtest.c | 3 ++- .../qemuhotplug-disk-scsi-2.xml | 2 +- .../qemuhotplug-base-with-scsi-controller-live.xml | 8 ++++---- ...base-without-scsi-controller-live+disk-scsi-2.xml | 12 ++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 804e32279d..819d9215e7 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -70,6 +70,7 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, priv->qemuCaps =3D virQEMUCapsNew(); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_LSI); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_PLAIN); @@ -790,7 +791,7 @@ mymain(void) DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", true, = true, "device_del", QMP_OK); DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", false,= false, - "device_del", QMP_DEVICE_DELETED("scsi3-0-5-6") QMP_OK, + "device_del", QMP_DEVICE_DELETED("scsi3-0-6") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml b/tes= ts/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml index 876afb182f..97f8ab1418 100644 --- a/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml +++ b/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml @@ -2,7 +2,7 @@ -
+
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-contro= ller-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-con= troller-live.xml index a61a68f561..939cea4cbe 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-controller-li= ve.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-controller-li= ve.xml @@ -26,19 +26,19 @@ - +
- +
- +
- +
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-con= troller-live+disk-scsi-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-bas= e-without-scsi-controller-live+disk-scsi-2.xml index 71dd10d40d..97f651374d 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller= -live+disk-scsi-2.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller= -live+disk-scsi-2.xml @@ -26,8 +26,8 @@ - -
+ +
@@ -36,19 +36,19 @@ - +
- +
- +
- +
--=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183612; cv=none; d=zohomail.com; s=zohoarc; b=YZoFbU323rVet+bPNvdNueb5vyRGIDOrbuV5ZMD6GCzbwUCpIhXUFaRmSM5KcbSAF36i2LtaOr+kKedtCJfHZtVooN0bM971kCuA/utm6cdOmP+IWqtlIw9aR5elaJCYts2Rb7St2cGTo2E31pev3K9AskwmGS2E3r0FllDnLVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183612; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vYV3tVovl+Fpsz8+g5WDek/OEKR958S0vgJ4IVuYed4=; b=YbVfZ/X2kgpfTzWt3MRJSFaL/Odvjtb/YECSd4hJIWGfJtC5jaJSTPzd4ZDkpd93hYzkofRmT+QTgS7/W5tL8UVVUgaMUzlMJ8Cu4pp5df9GeeqhLi51IiF19yAxbTD7TnLhRFXjl7sSevEq8e0a34W7ICQa2psnEHNJT9Jhs0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183612398210.94752528408378; Thu, 30 Mar 2023 06:40:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-bWQ3LG9JO7Skvi8HTNOUEQ-1; Thu, 30 Mar 2023 09:40:08 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AEB9185A794; Thu, 30 Mar 2023 13:40:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68558492C3E; Thu, 30 Mar 2023 13:40:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E6B7019451FE; Thu, 30 Mar 2023 13:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D8EC619465B5 for ; Thu, 30 Mar 2023 13:38:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D491E2166B34; Thu, 30 Mar 2023 13:38:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 407D92166B36 for ; Thu, 30 Mar 2023 13:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183611; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vYV3tVovl+Fpsz8+g5WDek/OEKR958S0vgJ4IVuYed4=; b=H6xjq+wQJYbvZizhpZXRt3mtKhLw1pPFiIwVSCGKUvRRiu6e8u198I5aRITLw7KVWSz48k ZCwbkWclLE/EZ0+T4fOI673S9IeEiUOGf0wsRUQlWHqAsq6ct4kY5QiqChfP8bXarP3Rwv DXgdGSnAD6F4rfmbQrpQ5BYgryKUdXY= X-MC-Unique: bWQ3LG9JO7Skvi8HTNOUEQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 18/31] qemuhotplugtest: Assert QEMU_CAPS_SET_ACTION Date: Thu, 30 Mar 2023 15:38:12 +0200 Message-Id: <12e0a5a3c253bdbd9445e3d7667e25d25badebf2.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183614429100001 Content-Type: text/plain; charset="utf-8" With modern qemu we use 'set-action' instead of 'watchdog-set-action'. Switch to it so that later qemuhotplugtest can be switched to use real capabilities. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 819d9215e7..5f69afc7d4 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -89,6 +89,7 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_BLOCK); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_KBD); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_NETDEV_VHOST_VDPA); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SET_ACTION); if (qemuTestCapsCacheInsert(driver.qemuCapsCache, priv->qemuCaps) < 0) return -1; @@ -899,13 +900,13 @@ mymain(void) ); DO_TEST_ATTACH("base-live", "watchdog", false, true, - "watchdog-set-action", QMP_OK, + "set-action", QMP_OK, "device_add", QMP_OK); DO_TEST_DETACH("base-live", "watchdog-full", false, false, "device_del", QMP_DEVICE_DELETED("watchdog0") QMP_OK); DO_TEST_ATTACH("base-live", "watchdog-user-alias", false, true, - "watchdog-set-action", QMP_OK, + "set-action", QMP_OK, "device_add", QMP_OK); DO_TEST_DETACH("base-live", "watchdog-user-alias-full", false, false, "device_del", QMP_DEVICE_DELETED("ua-UserWatchdog") QMP= _OK); --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183619; cv=none; d=zohomail.com; s=zohoarc; b=O8LSVav/tYecUobeeTMBKDO/fuJJkEewlE+6a86RpuH9gSFn7PB1RToNneexRYnpAjEcBvW7ibbqTPWjPWq0NaXmwCj9SSEd+3hqZ+FOBdTpTduuo/tpQcK3FcXq6awNl3/EyNIKPo9lAFF1iEUqjJ95MEf3nUhmeVUciz+gsMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183619; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ej+6DWeusiBQRrPpf+SgWDz+amGUnklR42k8D7ngzAE=; b=e5VqDNLcMstTQqDr35S1YcBpg8w2QGClO/q/sm6feVnmamARqLL33z4iwx3YnhdTLHFE7t/J2zLQSqRg/uDPycyulhSBWZRGo9hpBWolC/lHU5n2rXnjKnDl0+q/Z7PHygBCzGpSJT3f96dRHzjgygxE2PUyUo4LibfObufeAMc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1680183619903607.6537087560088; Thu, 30 Mar 2023 06:40:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-GR_zaDlDP3atHzfzKylNqA-1; Thu, 30 Mar 2023 09:40:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E03E93814943; Thu, 30 Mar 2023 13:40:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE356440D9; Thu, 30 Mar 2023 13:40:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 335BD1949747; Thu, 30 Mar 2023 13:38:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C127919465B5 for ; Thu, 30 Mar 2023 13:38:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A50F12166B33; Thu, 30 Mar 2023 13:38:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CAC92166B34 for ; Thu, 30 Mar 2023 13:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183618; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ej+6DWeusiBQRrPpf+SgWDz+amGUnklR42k8D7ngzAE=; b=I3SA3WhSgIQRpzE2sI09Q6e7V4fXiueuoy1S5xbZqQnchOa+YXBISYZ2AqI/d1C8EGQMo6 APYzJ0CTH3Yex8tlopS5Vz2ILAu3lSgfnnNsyrZ1/gSATN3Au0Y8ASWQe5/fZqqga47Byz cUXmqZOGE5kRV78Egk1h0GmNlBESg6U= X-MC-Unique: GR_zaDlDP3atHzfzKylNqA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/31] qemuhotplugtest: Refactor calling of testQemuHotplugCpuPrepare Date: Thu, 30 Mar 2023 15:38:13 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183620480100001 Content-Type: text/plain; charset="utf-8" Pass in the whole struct rather than splitting out individual members. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtest.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 5f69afc7d4..186958cd57 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -471,21 +471,29 @@ testQemuHotplugCpuDataFree(struct testQemuHotplugCpuD= ata *data) } +struct testQemuHotplugCpuParams { + const char *test; + int newcpus; + const char *cpumap; + bool state; + bool modern; + bool fail; + GHashTable *schema; +}; + + static struct testQemuHotplugCpuData * -testQemuHotplugCpuPrepare(const char *test, - bool modern, - bool fail, - GHashTable *qmpschema) +testQemuHotplugCpuPrepare(const struct testQemuHotplugCpuParams *params) { qemuDomainObjPrivate *priv =3D NULL; g_autofree char *prefix =3D NULL; struct testQemuHotplugCpuData *data =3D NULL; - prefix =3D g_strdup_printf("%s/qemuhotplugtestcpus/%s", abs_srcdir, te= st); + prefix =3D g_strdup_printf("%s/qemuhotplugtestcpus/%s", abs_srcdir, pa= rams->test); data =3D g_new0(struct testQemuHotplugCpuData, 1); - data->modern =3D modern; + data->modern =3D params->modern; data->file_xml_dom =3D g_strdup_printf("%s-domain.xml", prefix); data->file_xml_res_live =3D g_strdup_printf("%s-result-live.xml", pref= ix); @@ -509,10 +517,10 @@ testQemuHotplugCpuPrepare(const char *test, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); if (!(data->mon =3D qemuMonitorTestNewFromFileFull(data->file_json_mon= itor, - &driver, data->vm, qm= pschema))) + &driver, data->vm, pa= rams->schema))) goto error; - if (fail) + if (params->fail) qemuMonitorTestAllowUnusedCommands(data->mon); if (!data->modern) @@ -561,17 +569,6 @@ testQemuHotplugCpuFinalize(struct testQemuHotplugCpuDa= ta *data) } -struct testQemuHotplugCpuParams { - const char *test; - int newcpus; - const char *cpumap; - bool state; - bool modern; - bool fail; - GHashTable *schema; -}; - - static int testQemuHotplugCpuGroup(const void *opaque) { @@ -580,8 +577,7 @@ testQemuHotplugCpuGroup(const void *opaque) int ret =3D -1; int rc; - if (!(data =3D testQemuHotplugCpuPrepare(params->test, params->modern, - params->fail, params->schema))) + if (!(data =3D testQemuHotplugCpuPrepare(params))) return -1; rc =3D qemuDomainSetVcpusInternal(&driver, data->vm, data->vm->def, @@ -617,8 +613,7 @@ testQemuHotplugCpuIndividual(const void *opaque) int ret =3D -1; int rc; - if (!(data =3D testQemuHotplugCpuPrepare(params->test, params->modern, - params->fail, params->schema))) + if (!(data =3D testQemuHotplugCpuPrepare(params))) return -1; if (virBitmapParse(params->cpumap, &map, 128) < 0) --=20 2.39.2 From nobody Mon Feb 9 00:27:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680183626; cv=none; d=zohomail.com; s=zohoarc; b=OBbKVIpKyMJlPsZ13xJah1mUq+vxPURQ0U+B06eFVDAPMQt32+4Ja0M2kiIR9Rsu/snbB5hktAM/9DrJF53Oh8MPp0cnUKphs8KFX/iLWo32+gyNkeKKQ1s20LvewL3OSVDC9h5LjPq6RlwGA6TQuwfuHVFHp2taI8LnNbNEqEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183626; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0gZo86PWJ6Mtln/SaGW6fWvT7qFYseaqOHHQvIsymvM=; b=Mjjn3k7jf2CAJ7+cz243KZm7xqGEe9l38CA3XGbt7Nj1W5rLRxCdmiHLMamH34sEL8UjTbVuERlTcqfiJQKAM2vMdGpzWgY+AAk2RP1Z7Ev9jBHb3SLu/djMX6lS77W6MaJrh8umEDTISGhhZFMcujNxntfj7IEVs751ZM3NpoY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680183626398710.858091231917; Thu, 30 Mar 2023 06:40:26 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-154-KELz1tJPOXuQmS08sxt3vQ-1; Thu, 30 Mar 2023 09:40:23 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B22D85C075; Thu, 30 Mar 2023 13:40:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 338CE14171BF; Thu, 30 Mar 2023 13:40:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 72C271949755; Thu, 30 Mar 2023 13:38:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D151B1946597 for ; Thu, 30 Mar 2023 13:38:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CCC0A2166B34; Thu, 30 Mar 2023 13:38:46 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1752F2166B33 for ; Thu, 30 Mar 2023 13:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183625; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0gZo86PWJ6Mtln/SaGW6fWvT7qFYseaqOHHQvIsymvM=; b=FWBaVox7eYntRBhu9tkjbkORQdxABVbpHaXqeIMPdN5nAF2Ju2GSMlWsldcfH+dpVNLGCl tsklYZoktWFjZMZZWa0kTxE83ZjGo4ZEUPof8KkSxZBZjz1woDj+TPbTKaF3K84cskaJjH gDMx3SA+HyMrjh5UxYRxsDUphANtNtM= X-MC-Unique: KELz1tJPOXuQmS08sxt3vQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/31] qemuhotplugtest: Use real 'latest' capabilities for hotplug testing Date: Thu, 30 Mar 2023 15:38:14 +0200 Message-Id: <059907f691f30cf7810f7622ea7b403ef3e32293.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680183628537100001 Content-Type: text/plain; charset="utf-8" Rather than test with synthetic capabilities which might get outdated reuse testQemuGetRealCaps to fetch latest capabilities and use those. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuhotplugtest.c | 231 +++++++++--------- .../ppc64-modern-bulk-result-conf.xml | 5 +- .../ppc64-modern-bulk-result-live.xml | 5 +- .../ppc64-modern-individual-result-conf.xml | 5 +- .../ppc64-modern-individual-result-live.xml | 5 +- .../x86-modern-bulk-result-conf.xml | 5 +- .../x86-modern-bulk-result-live.xml | 5 +- .../x86-modern-individual-add-result-conf.xml | 5 +- .../x86-modern-individual-add-result-live.xml | 5 +- .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 13 +- ...with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 13 +- ...otplug-base-ccw-live-with-2-ccw-virtio.xml | 13 +- ...-with-ccw-virtio+ccw-virtio-2-explicit.xml | 13 +- ...-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 13 +- ...uhotplug-base-ccw-live-with-ccw-virtio.xml | 13 +- .../qemuhotplug-base-ccw-live.xml | 13 +- .../qemuhotplug-base-live+cdrom-scsi.xml | 5 +- .../qemuhotplug-base-live+cdrom-usb.xml | 5 +- ...uhotplug-base-live+disk-scsi-multipath.xml | 5 +- ...+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml | 5 +- .../qemuhotplug-base-live+disk-scsi.xml | 5 +- .../qemuhotplug-base-live+disk-usb.xml | 5 +- .../qemuhotplug-base-live+disk-virtio.xml | 5 +- .../qemuhotplug-base-live+guestfwd.xml | 5 +- .../qemuhotplug-base-live+hostdev-pci.xml | 5 +- .../qemuhotplug-base-live+interface-vdpa.xml | 5 +- ...qemuhotplug-base-live+ivshmem-doorbell.xml | 5 +- .../qemuhotplug-base-live+ivshmem-plain.xml | 5 +- .../qemuhotplug-base-live+qemu-agent.xml | 5 +- ...uhotplug-base-live+watchdog-user-alias.xml | 5 +- .../qemuhotplug-base-live+watchdog.xml | 5 +- .../qemuhotplug-base-live.xml | 5 +- ...hotplug-base-with-scsi-controller-live.xml | 5 +- ...thout-scsi-controller-live+disk-scsi-2.xml | 5 +- ...g-console-compat-2-live+console-virtio.xml | 5 +- .../qemuhotplug-console-compat-2-live.xml | 5 +- ...uhotplug-pseries-base-live+hostdev-pci.xml | 5 +- .../qemuhotplug-pseries-base-live.xml | 5 +- 38 files changed, 299 insertions(+), 173 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 186958cd57..9c8407c5ef 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -53,12 +53,22 @@ struct qemuHotplugTestData { bool keep; virDomainObj *vm; bool deviceDeletedEvent; + const char *arch; + GHashTable *capsLatestFiles; + GHashTable *capsCache; + GHashTable *schemaCache; }; static int qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, virDomainObj **vm, - const char *domxml) + const char *domxml, + const char *arch, + GHashTable *capsLatestFiles, + GHashTable *capsCache, + GHashTable *schemaCache, + GHashTable **schema) + { qemuDomainObjPrivate *priv =3D NULL; const unsigned int parseFlags =3D 0; @@ -68,28 +78,10 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, priv =3D (*vm)->privateData; - priv->qemuCaps =3D virQEMUCapsNew(); - - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_LSI); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_PLAIN); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_DISK_WWN); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_QXL); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_VGA); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_PIIX_DISABLE_S3); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_PIIX_DISABLE_S4); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VNC); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SPICE); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_BLOCK); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_KBD); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_NETDEV_VHOST_VDPA); - virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SET_ACTION); + if (!(priv->qemuCaps =3D testQemuGetRealCaps(arch, "latest", "", + capsLatestFiles, capsCache, + schemaCache, schema))) + return -1; if (qemuTestCapsCacheInsert(driver.qemuCapsCache, priv->qemuCaps) < 0) return -1; @@ -347,7 +339,10 @@ testQemuHotplug(const void *data) goto cleanup; } } else { - if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml) < 0) + if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml, + test->arch, test->capsLatestFiles, + test->capsCache, test->schemaCache, + NULL) < 0) goto cleanup; } @@ -478,7 +473,10 @@ struct testQemuHotplugCpuParams { bool state; bool modern; bool fail; - GHashTable *schema; + const char *arch; + GHashTable *capsLatestFiles; + GHashTable *capsCache; + GHashTable *schemaCache; }; @@ -488,6 +486,7 @@ testQemuHotplugCpuPrepare(const struct testQemuHotplugC= puParams *params) qemuDomainObjPrivate *priv =3D NULL; g_autofree char *prefix =3D NULL; struct testQemuHotplugCpuData *data =3D NULL; + GHashTable *schema =3D NULL; prefix =3D g_strdup_printf("%s/qemuhotplugtestcpus/%s", abs_srcdir, pa= rams->test); @@ -503,7 +502,9 @@ testQemuHotplugCpuPrepare(const struct testQemuHotplugC= puParams *params) if (virTestLoadFile(data->file_xml_dom, &data->xml_dom) < 0) goto error; - if (qemuHotplugCreateObjects(driver.xmlopt, &data->vm, data->xml_dom) = < 0) + if (qemuHotplugCreateObjects(driver.xmlopt, &data->vm, data->xml_dom, + params->arch, params->capsLatestFiles, + params->capsCache, params->schemaCache, &= schema) < 0) goto error; /* create vm->newDef */ @@ -517,7 +518,7 @@ testQemuHotplugCpuPrepare(const struct testQemuHotplugC= puParams *params) virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); if (!(data->mon =3D qemuMonitorTestNewFromFileFull(data->file_json_mon= itor, - &driver, data->vm, pa= rams->schema))) + &driver, data->vm, sc= hema))) goto error; if (params->fail) @@ -645,11 +646,17 @@ testQemuHotplugCpuIndividual(const void *opaque) static int mymain(void) { - g_autoptr(GHashTable) qmpschema =3D NULL; int ret =3D 0; - struct qemuHotplugTestData data =3D {0}; - struct testQemuHotplugCpuParams cpudata; g_autoptr(virQEMUDriverConfig) cfg =3D NULL; + g_autoptr(GHashTable) capsLatestFiles =3D testQemuGetLatestCaps(); + g_autoptr(GHashTable) capsCache =3D virHashNew(virObjectUnref); + g_autoptr(GHashTable) schemaCache =3D virHashNew((GDestroyNotify) g_ha= sh_table_unref); + struct qemuHotplugTestData data =3D { .capsLatestFiles =3D capsLatestF= iles, + .capsCache =3D capsCache, + .schemaCache =3D schemaCache }; + struct testQemuHotplugCpuParams cpudata =3D { .capsLatestFiles =3D cap= sLatestFiles, + .capsCache =3D capsCache, + .schemaCache =3D schemaCac= he }; if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; @@ -661,13 +668,6 @@ mymain(void) if (!(driver.domainEventState =3D virObjectEventStateNew())) return EXIT_FAILURE; - if (!(qmpschema =3D testQEMUSchemaLoadLatest("x86_64"))) { - VIR_TEST_VERBOSE("failed to load qapi schema\n"); - return EXIT_FAILURE; - } - - cpudata.schema =3D qmpschema; - driver.lockManager =3D virLockManagerPluginNew("nop", "qemu", driver.config->configBase= Dir, 0); @@ -682,10 +682,11 @@ mymain(void) } -#define DO_TEST(file, ACTION, dev, fail_, keep_, ...) \ +#define DO_TEST(archname, file, ACTION, dev, fail_, keep_, ...) \ do { \ const char *my_mon[] =3D { __VA_ARGS__, NULL}; \ const char *name =3D file " " #ACTION " " dev; \ + data.arch =3D archname; \ data.action =3D ACTION; \ data.domain_filename =3D file; \ data.device_filename =3D dev; \ @@ -696,14 +697,14 @@ mymain(void) ret =3D -1; \ } while (0) -#define DO_TEST_ATTACH(file, dev, fail, keep, ...) \ - DO_TEST(file, ATTACH, dev, fail, keep, __VA_ARGS__) +#define DO_TEST_ATTACH(arch, file, dev, fail, keep, ...) \ + DO_TEST(arch, file, ATTACH, dev, fail, keep, __VA_ARGS__) -#define DO_TEST_DETACH(file, dev, fail, keep, ...) \ - DO_TEST(file, DETACH, dev, fail, keep, __VA_ARGS__) +#define DO_TEST_DETACH(arch, file, dev, fail, keep, ...) \ + DO_TEST(arch, file, DETACH, dev, fail, keep, __VA_ARGS__) -#define DO_TEST_UPDATE(file, dev, fail, keep, ...) \ - DO_TEST(file, UPDATE, dev, fail, keep, __VA_ARGS__) +#define DO_TEST_UPDATE(arch, file, dev, fail, keep, ...) \ + DO_TEST(arch, file, UPDATE, dev, fail, keep, __VA_ARGS__) #define QMP_OK "{\"return\": {}}" @@ -722,60 +723,60 @@ mymain(void) "}\r\n" cfg->spiceTLS =3D true; - DO_TEST_UPDATE("graphics-spice", "graphics-spice-nochange", false, fal= se, NULL); - DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-nocha= nge", false, false, + DO_TEST_UPDATE("x86_64", "graphics-spice", "graphics-spice-nochange", = false, false, NULL); + DO_TEST_UPDATE("x86_64", "graphics-spice-timeout", "graphics-spice-tim= eout-nochange", false, false, "set_password", QMP_OK, "expire_password", QMP_OK); - DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-passw= ord", false, false, + DO_TEST_UPDATE("x86_64", "graphics-spice-timeout", "graphics-spice-tim= eout-password", false, false, "set_password", QMP_OK, "expire_password", QMP_OK); - DO_TEST_UPDATE("graphics-spice", "graphics-spice-listen", true, false,= NULL); - DO_TEST_UPDATE("graphics-spice-listen-network", "graphics-spice-listen= -network-password", false, false, + DO_TEST_UPDATE("x86_64", "graphics-spice", "graphics-spice-listen", tr= ue, false, NULL); + DO_TEST_UPDATE("x86_64", "graphics-spice-listen-network", "graphics-sp= ice-listen-network-password", false, false, "set_password", QMP_OK, "expire_password", QMP_OK); cfg->spiceTLS =3D false; /* Strange huh? Currently, only graphics can be updated :-P */ - DO_TEST_UPDATE("disk-cdrom", "disk-cdrom-nochange", true, false, NULL); + DO_TEST_UPDATE("x86_64", "disk-cdrom", "disk-cdrom-nochange", true, fa= lse, NULL); - DO_TEST_ATTACH("console-compat-2-live", "console-virtio", false, true, + DO_TEST_ATTACH("x86_64", "console-compat-2-live", "console-virtio", fa= lse, true, "chardev-add", "{\"return\": {\"pty\": \"/dev/pts/26\"}= }", "device_add", QMP_OK); - DO_TEST_DETACH("console-compat-2-live", "console-virtio", false, false, + DO_TEST_DETACH("x86_64", "console-compat-2-live", "console-virtio", fa= lse, false, "device_del", QMP_DEVICE_DELETED("console1") QMP_OK, "chardev-remove", QMP_OK, "query-fdsets", "{\"return\":= []}"); - DO_TEST_ATTACH("base-live", "disk-virtio", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "disk-virtio", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "disk-virtio", true, true, + DO_TEST_DETACH("x86_64", "base-live", "disk-virtio", true, true, "device_del", QMP_OK); - DO_TEST_DETACH("base-live", "disk-virtio", false, false, + DO_TEST_DETACH("x86_64", "base-live", "disk-virtio", false, false, "device_del", QMP_DEVICE_DELETED("virtio-disk4") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-live", "disk-usb", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "disk-usb", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "disk-usb", true, true, + DO_TEST_DETACH("x86_64", "base-live", "disk-usb", true, true, "device_del", QMP_OK); - DO_TEST_DETACH("base-live", "disk-usb", false, false, + DO_TEST_DETACH("x86_64", "base-live", "disk-usb", false, false, "device_del", QMP_DEVICE_DELETED("usb-disk16") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-live", "disk-scsi", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "disk-scsi", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "disk-scsi", true, true, + DO_TEST_DETACH("x86_64", "base-live", "disk-scsi", true, true, "device_del", QMP_OK); - DO_TEST_DETACH("base-live", "disk-scsi", false, false, + DO_TEST_DETACH("x86_64", "base-live", "disk-scsi", false, false, "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-without-scsi-controller-live", "disk-scsi-2", fal= se, true, + DO_TEST_ATTACH("x86_64", "base-without-scsi-controller-live", "disk-sc= si-2", false, true, /* Four controllers added */ "device_add", QMP_OK, "device_add", QMP_OK, @@ -784,109 +785,109 @@ mymain(void) "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", true, = true, + DO_TEST_DETACH("x86_64", "base-with-scsi-controller-live", "disk-scsi-= 2", true, true, "device_del", QMP_OK); - DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", false,= false, + DO_TEST_DETACH("x86_64", "base-with-scsi-controller-live", "disk-scsi-= 2", false, false, "device_del", QMP_DEVICE_DELETED("scsi3-0-6") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-live", "disk-scsi-multipath", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "disk-scsi-multipath", false, tr= ue, "object-add", QMP_OK, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "disk-scsi-multipath", true, true, + DO_TEST_DETACH("x86_64", "base-live", "disk-scsi-multipath", true, tru= e, "device_del", QMP_OK); - DO_TEST_DETACH("base-live", "disk-scsi-multipath", false, false, + DO_TEST_DETACH("x86_64", "base-live", "disk-scsi-multipath", false, fa= lse, "device_del", QMP_DEVICE_DELETED("scsi0-0-0-0") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK, "object-del", QMP_OK); - DO_TEST_ATTACH("base-live", "qemu-agent", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "qemu-agent", false, true, "getfd", QMP_OK, "chardev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "qemu-agent-detach", false, false, + DO_TEST_DETACH("x86_64", "base-live", "qemu-agent-detach", false, fals= e, "device_del", QMP_DEVICE_DELETED("channel0") QMP_OK, "chardev-remove", QMP_OK, "query-fdsets", "{\"return\":= []}"); - DO_TEST_ATTACH("base-ccw-live", "ccw-virtio", false, true, + DO_TEST_ATTACH("s390x", "base-ccw-live", "ccw-virtio", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-ccw-live", "ccw-virtio", false, false, + DO_TEST_DETACH("s390x", "base-ccw-live", "ccw-virtio", false, false, "device_del", QMP_DEVICE_DELETED("virtio-disk4") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false,= true, + DO_TEST_ATTACH("s390x", "base-ccw-live-with-ccw-virtio", "ccw-virtio-2= ", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false,= false, + DO_TEST_DETACH("s390x", "base-ccw-live-with-ccw-virtio", "ccw-virtio-2= ", false, false, "device_del", QMP_DEVICE_DELETED("virtio-disk0") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit= ", false, true, + DO_TEST_ATTACH("s390x", "base-ccw-live-with-ccw-virtio", "ccw-virtio-2= -explicit", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit= ", false, false, + DO_TEST_DETACH("s390x", "base-ccw-live-with-ccw-virtio", "ccw-virtio-2= -explicit", false, false, "device_del", QMP_DEVICE_DELETED("virtio-disk0") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); /* Attach a second device, then detach the first one. Then attach the = first one again. */ - DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit= ", false, true, + DO_TEST_ATTACH("s390x", "base-ccw-live-with-ccw-virtio", "ccw-virtio-2= -explicit", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-explic= it", false, true, + DO_TEST_DETACH("s390x", "base-ccw-live-with-2-ccw-virtio", "ccw-virtio= -1-explicit", false, true, "device_del", QMP_DEVICE_DELETED("virtio-disk4") QMP_OK= ); - DO_TEST_ATTACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-revers= e", false, false, + DO_TEST_ATTACH("s390x", "base-ccw-live-with-2-ccw-virtio", "ccw-virtio= -1-reverse", false, false, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_ATTACH("base-live", "ivshmem-plain", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "ivshmem-plain", false, true, "object-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_ATTACH("base-live", "ivshmem-doorbell", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "ivshmem-doorbell", false, true, "chardev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live+ivshmem-plain", "ivshmem-doorbell-detach", f= alse, true, + DO_TEST_DETACH("x86_64", "base-live+ivshmem-plain", "ivshmem-doorbell-= detach", false, true, "device_del", QMP_DEVICE_DELETED("shmem1") QMP_OK, "chardev-remove", QMP_OK); - DO_TEST_DETACH("base-live", "ivshmem-plain-detach", false, false, + DO_TEST_DETACH("x86_64", "base-live", "ivshmem-plain-detach", false, f= alse, "device_del", QMP_DEVICE_DELETED("shmem0") QMP_OK, "object-del", QMP_OK); - DO_TEST_ATTACH("base-live+disk-scsi-wwn", + DO_TEST_ATTACH("x86_64", "base-live+disk-scsi-wwn", "disk-scsi-duplicate-wwn", false, false, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_ATTACH("base-live", "hostdev-pci", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "hostdev-pci", false, true, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "hostdev-pci", false, false, + DO_TEST_DETACH("x86_64", "base-live", "hostdev-pci", false, false, "device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK); - DO_TEST_ATTACH("pseries-base-live", "hostdev-pci", false, true, + DO_TEST_ATTACH("ppc64", "pseries-base-live", "hostdev-pci", false, tru= e, "device_add", QMP_OK); - DO_TEST_DETACH("pseries-base-live", "hostdev-pci", false, false, + DO_TEST_DETACH("ppc64", "pseries-base-live", "hostdev-pci", false, fal= se, "device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK); - DO_TEST_ATTACH("base-live", "interface-vdpa", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "interface-vdpa", false, true, "query-fdsets", "{\"return\":[{\"fdset-id\":99999}]}", "add-fd", "{ \"return\": { \"fdset-id\": 1, \"fd\": 95 = }}", "netdev_add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "interface-vdpa", false, false, + DO_TEST_DETACH("x86_64", "base-live", "interface-vdpa", false, false, "device_del", QMP_DEVICE_DELETED("net0") QMP_OK, "netdev_del", QMP_OK, "query-fdsets", @@ -894,50 +895,51 @@ mymain(void) "remove-fd", QMP_OK ); - DO_TEST_ATTACH("base-live", "watchdog", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "watchdog", false, true, "set-action", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "watchdog-full", false, false, + DO_TEST_DETACH("x86_64", "base-live", "watchdog-full", false, false, "device_del", QMP_DEVICE_DELETED("watchdog0") QMP_OK); - DO_TEST_ATTACH("base-live", "watchdog-user-alias", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "watchdog-user-alias", false, tr= ue, "set-action", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "watchdog-user-alias-full", false, false, + DO_TEST_DETACH("x86_64", "base-live", "watchdog-user-alias-full", fals= e, false, "device_del", QMP_DEVICE_DELETED("ua-UserWatchdog") QMP= _OK); - DO_TEST_ATTACH("base-live", "guestfwd", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "guestfwd", false, true, "getfd", QMP_OK, "chardev-add", QMP_OK, "netdev_add", QMP_OK); - DO_TEST_DETACH("base-live", "guestfwd", false, false, + DO_TEST_DETACH("x86_64", "base-live", "guestfwd", false, false, "netdev_del", QMP_OK); - DO_TEST_ATTACH("base-live", "cdrom-usb", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "cdrom-usb", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "cdrom-usb", true, true, + DO_TEST_DETACH("x86_64", "base-live", "cdrom-usb", true, true, "device_del", QMP_OK); - DO_TEST_DETACH("base-live", "cdrom-usb", false, false, + DO_TEST_DETACH("x86_64", "base-live", "cdrom-usb", false, false, "device_del", QMP_DEVICE_DELETED("usb-disk4") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); - DO_TEST_ATTACH("base-live", "cdrom-scsi", false, true, + DO_TEST_ATTACH("x86_64", "base-live", "cdrom-scsi", false, true, "blockdev-add", QMP_OK, "blockdev-add", QMP_OK, "device_add", QMP_OK); - DO_TEST_DETACH("base-live", "cdrom-scsi", true, true, + DO_TEST_DETACH("x86_64", "base-live", "cdrom-scsi", true, true, "device_del", QMP_OK); - DO_TEST_DETACH("base-live", "cdrom-scsi", false, false, + DO_TEST_DETACH("x86_64", "base-live", "cdrom-scsi", false, false, "device_del", QMP_DEVICE_DELETED("scsi0-0-0-4") QMP_OK, "blockdev-del", QMP_OK, "blockdev-del", QMP_OK); -#define DO_TEST_CPU_GROUP(prefix, vcpus, modernhp, expectfail) \ +#define DO_TEST_CPU_GROUP(archname, prefix, vcpus, modernhp, expectfail) \ do { \ cpudata.test =3D prefix; \ + cpudata.arch =3D archname; \ cpudata.newcpus =3D vcpus; \ cpudata.modern =3D modernhp; \ cpudata.fail =3D expectfail; \ @@ -946,15 +948,16 @@ mymain(void) ret =3D -1; \ } while (0) - DO_TEST_CPU_GROUP("x86-modern-bulk", 7, true, false); - DO_TEST_CPU_GROUP("ppc64-modern-bulk", 24, true, false); - DO_TEST_CPU_GROUP("ppc64-modern-bulk", 15, true, true); - DO_TEST_CPU_GROUP("ppc64-modern-bulk", 23, true, true); - DO_TEST_CPU_GROUP("ppc64-modern-bulk", 25, true, true); + DO_TEST_CPU_GROUP("x86_64", "x86-modern-bulk", 7, true, false); + DO_TEST_CPU_GROUP("ppc64", "ppc64-modern-bulk", 24, true, false); + DO_TEST_CPU_GROUP("ppc64", "ppc64-modern-bulk", 15, true, true); + DO_TEST_CPU_GROUP("ppc64", "ppc64-modern-bulk", 23, true, true); + DO_TEST_CPU_GROUP("ppc64", "ppc64-modern-bulk", 25, true, true); -#define DO_TEST_CPU_INDIVIDUAL(prefix, mapstr, statefl, modernhp, expectfa= il) \ +#define DO_TEST_CPU_INDIVIDUAL(archname, prefix, mapstr, statefl, modernhp= , expectfail) \ do { \ cpudata.test =3D prefix; \ + cpudata.arch =3D archname; \ cpudata.cpumap =3D mapstr; \ cpudata.state =3D statefl; \ cpudata.modern =3D modernhp; \ @@ -964,13 +967,13 @@ mymain(void) ret =3D -1; \ } while (0) - DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "7", true, true, f= alse); - DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "6,7", true, true,= true); - DO_TEST_CPU_INDIVIDUAL("x86-modern-individual-add", "7", false, true, = true); + DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", tru= e, true, false); + DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "6,7", t= rue, true, true); + DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", fal= se, true, true); - DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "16-23", true, true,= false); - DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "16-22", true, true,= true); - DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "17", true, true, tr= ue); + DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "16-23", tr= ue, true, false); + DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "16-22", tr= ue, true, true); + DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "17", true,= true, true); qemuTestDriverFree(&driver); virObjectUnref(data.vm); diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml b/= tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml index a7ada18bf3..afb2c85bc2 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml @@ -42,7 +42,8 @@ hvm - + + qemu64 @@ -51,7 +52,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml b/= tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml index 3932fd9b55..d86247d70c 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml @@ -42,7 +42,8 @@ hvm - + + qemu64 @@ -51,7 +52,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.= xml b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml index f3a1efeede..e8d30f7ddd 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml @@ -42,7 +42,8 @@ hvm - + + qemu64 @@ -51,7 +52,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.= xml b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml index 6d64ead3d0..afc500657c 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml @@ -42,7 +42,8 @@ hvm - + + qemu64 @@ -51,7 +52,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml b/te= sts/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml index 87eb19ebd8..8d52ffedb4 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml +++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml @@ -18,7 +18,8 @@ hvm - + + qemu64 @@ -27,7 +28,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml b/te= sts/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml index 251634e266..f416397e33 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml +++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml @@ -18,7 +18,8 @@ hvm - + + qemu64 @@ -27,7 +28,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-con= f.xml b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml index 140892aaf8..0bd2af8e43 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml +++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml @@ -18,7 +18,8 @@ hvm - + + qemu64 @@ -27,7 +28,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-liv= e.xml b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml index 45196ba1d1..b31e6ebe55 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml +++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml @@ -18,7 +18,8 @@ hvm - + + qemu64 @@ -27,7 +28,7 @@ destroy /usr/bin/qemu-system-x86_64 - +
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-vir= tio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio= .xml index 4036adde89..798a7ab732 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml @@ -13,6 +13,7 @@ + destroy restart @@ -31,18 +32,24 @@ -
+
+ +
-
+
+ +
-
+
+ +