From nobody Sat Feb 7 15:29:54 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com 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 1643143809846379.7568711206537; Tue, 25 Jan 2022 12:50:09 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-GwYyjYO_PPmw0m0bkgqRlg-1; Tue, 25 Jan 2022 15:50:06 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6F6B18982A1; Tue, 25 Jan 2022 20:49:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C776C10114AE; Tue, 25 Jan 2022 20:49:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9A89F4A70F; Tue, 25 Jan 2022 20:49:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20PKnv0F024292 for ; Tue, 25 Jan 2022 15:49:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 80498C27FD9; Tue, 25 Jan 2022 20:49:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C710C35992 for ; Tue, 25 Jan 2022 20:49:54 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5877A8117B4 for ; Tue, 25 Jan 2022 20:49:42 +0000 (UTC) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-608-isePe6e8P3m0xJkokNvz3w-3; Tue, 25 Jan 2022 15:49:30 -0500 Received: by mail-ot1-f54.google.com with SMTP id z25-20020a0568301db900b005946f536d85so27594212oti.9 for ; Tue, 25 Jan 2022 12:49:30 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id ay32sm1368569oob.16.2022.01.25.12.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 12:49:30 -0800 (PST) X-MC-Unique: GwYyjYO_PPmw0m0bkgqRlg-1 X-MC-Unique: isePe6e8P3m0xJkokNvz3w-3 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u7T39eAoQUnfJNnHs7lb0DgpocBzH+rOuEfhETgJb9s=; b=G88DLR6UIciUTg5+g2XYG0+du2gPvZZaYZISbWlyxt6Kblm9BPrXCWIPUIddMRJL07 T6Bw4+uhm/b3nmbKfd8lSd4HbxxWLl+/3gf6IilJbH5OIMv38XYmpZiKvHGytZAFdSJU tqapq9sXn00s/zd6Yfz/wXHVqr+vBwobjJGgvjlpQGor1dpBLRTB/N15tBkn52pGOGUX IWRtb0Wro/kgaE+qs+XiDdgRjvjbCdMnsNvYEgEJe3eHQikhmppHiDSmbYOXhMvVwGky okClNySdnbr3WvwVFpNGsJwXwQX4k7Q8+uut9d8YP49Xbyqq5y+PBxkcyyqWJ4EfYMIT 50Hw== X-Gm-Message-State: AOAM53223PzSJZiCihPoJWQC5gcZtXGxPTLVqarHjpS/hlkT8yiMfjdV SLlngMPe9+oIQwHHS6nDpphfnWSmgQc= X-Google-Smtp-Source: ABdhPJz5cgpKE3j8bJDXD7Llij4NNnAjtjXkCpqc3f1pv8avACk5Uhja+IWCfchtm67I2u6ZDyYo3Q== X-Received: by 2002:a05:6830:4389:: with SMTP id s9mr15920273otv.59.1643143770210; Tue, 25 Jan 2022 12:49:30 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 09/29] qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB3 Date: Tue, 25 Jan 2022 17:48:42 -0300 Message-Id: <20220125204902.772350-10-danielhb413@gmail.com> In-Reply-To: <20220125204902.772350-1-danielhb413@gmail.com> References: <20220125204902.772350-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-loop: libvir-list@redhat.com Cc: danielhb413@gmail.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1643143811321100006 Content-Type: text/plain; charset="utf-8" QEMU_CAPS_DEVICE_PNV_PHB3 indicates binary support for the pnv-phb3 device, the pcie-root controller for PowerNV8 domains, and also the pnv-phb3-root-port device, its pcie-root-port device. This capability is present in QEMU since 5.0.0 but these devices are user-creatable only after QEMU 6.2.0. This means that probing it as default will be misleading for users. Instead, let's use virQEMUCapsInitQMPVersionCaps() to check for the adequate QEMU version and arch and set it manually. Suggested-by: Peter Krempa Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 19 +++++++++++++++++++ src/qemu/qemu_capabilities.h | 1 + .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 + 3 files changed, 21 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bb90715569..d60240912c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -662,6 +662,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 420 */ "device.json+hotplug", /* QEMU_CAPS_DEVICE_JSON */ "hvf", /* QEMU_CAPS_HVF */ + "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */ ); =20 =20 @@ -1397,6 +1398,17 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes= [] =3D { { "virtio-vga-gl", QEMU_CAPS_VIRTIO_VGA_GL }, { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, + /* + * We don't probe the following PowerNV devices: + * + * { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * { "pnv-phb3-root-port", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * + * Because they are present in QEMU binaries since QEMU 5.0.0 + * but became user creatable only in the QEMU 7.0.0 development + * cycle. Their respective capabilities are being set in + * virQEMUCapsInitQMPVersionCaps(). + */ }; =20 =20 @@ -5231,6 +5243,13 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) */ if (qemuCaps->version < 5002000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_FIPS); + + /* PowerNV pnv-phb devices weren't user creatable up to + * QEMU 6.2.0. The version value set here was taken from a + * binary post 6.2.0 release that has user creatable pnv-phb + * support. */ + if (qemuCaps->version >=3D 6002050 && ARCH_IS_PPC64(qemuCaps->arch)) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB3); } =20 =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c6fb87a73a..ed3973c0ba 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -637,6 +637,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 420 */ QEMU_CAPS_DEVICE_JSON, /* -device accepts JSON (and works with hot-unp= lug) */ QEMU_CAPS_HVF, /* Whether Hypervisor.framework is available */ + QEMU_CAPS_DEVICE_PNV_PHB3, /* devices pnv-phb3 and pnv-phb3-root-port = */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_7.0.0.ppc64.xml index 88eee87587..cb6c146a28 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml @@ -200,6 +200,7 @@ + 6002050 0 42900243 --=20 2.34.1