From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 170420203281987.39738230924365; Tue, 2 Jan 2024 05:27:12 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id B3D3C17BE; Tue, 2 Jan 2024 08:27:11 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8EB8716EA; Tue, 2 Jan 2024 08:25:50 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id BAD1D16EB; Tue, 2 Jan 2024 08:25:46 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D8A1E16EC for ; Tue, 2 Jan 2024 08:25:45 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:46 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:42 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950867" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950867" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201520" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201520" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 1/8] virpci: Define the vf-token extension for PCI device Date: Tue, 2 Jan 2024 18:55:11 +0530 Message-Id: <20240102132518.297-2-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: HEVHSC7AGGKZ2V5YN7O5WIIET2M2XGBY X-Message-ID-Hash: HEVHSC7AGGKZ2V5YN7O5WIIET2M2XGBY X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202034988100001 Define the vf-token extension for PCI device Signed-off-by: Vivek Kashyap --- src/util/virpci.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/virpci.h b/src/util/virpci.h index bc7cb2329f..da32c2f4d2 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -50,6 +50,13 @@ struct _virZPCIDeviceAddress { /* Don't forget to update virPCIDeviceAddressCopy if needed. */ }; =20 +typedef struct _virPCIDeviceToken virPCIDeviceToken; + +struct _virPCIDeviceToken { + unsigned char uuid[VIR_UUID_BUFLEN]; + bool isSet; +}; + struct _virPCIDeviceAddress { unsigned int domain; unsigned int bus; @@ -58,6 +65,7 @@ struct _virPCIDeviceAddress { virTristateSwitch multi; int extFlags; /* enum virPCIDeviceAddressExtensionFlags */ virZPCIDeviceAddress zpci; + virPCIDeviceToken token; /* Don't forget to update virPCIDeviceAddressCopy if needed. */ }; =20 --=20 2.33.8 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704202231746450.02341636231426; Tue, 2 Jan 2024 05:30:31 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 98DCE1712; Tue, 2 Jan 2024 08:30:30 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2C384179A; Tue, 2 Jan 2024 08:26:08 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id D4C5516EB; Tue, 2 Jan 2024 08:25:49 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8D68216EA for ; Tue, 2 Jan 2024 08:25:48 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:48 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:45 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950869" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950869" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201528" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201528" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 2/8] qemu: capabilities: Introduce QEMU_CAPS_VFIO_VFTOKEN Date: Tue, 2 Jan 2024 18:55:12 +0530 Message-Id: <20240102132518.297-3-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: PYV7V6FGH3MHKUDR7ZMT5SN7NDUVHIFF X-Message-ID-Hash: PYV7V6FGH3MHKUDR7ZMT5SN7NDUVHIFF X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202233726100001 Introduce the vf-token qemu capability Signed-off-by: Vivek Kashyap --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 + 5 files changed, 7 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 83119e871a..f4cacd48d0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -698,6 +698,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 450 */ "run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARD= OWN */ "virtio-blk-vhost-vdpa", /* QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOS= T_VDPA */ + "vf-token", /* QEMU_CAPS_VFIO_VFTOKEN */ ); =20 =20 @@ -1385,6 +1386,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "virtio-crypto-device", QEMU_CAPS_DEVICE_VIRTIO_CRYPTO }, { "cryptodev-backend-lkcf", QEMU_CAPS_OBJECT_CRYPTO_LKCF }, { "pvpanic-pci", QEMU_CAPS_DEVICE_PANIC_PCI }, + { "vf-token", QEMU_CAPS_VFIO_VFTOKEN }, }; =20 =20 @@ -1447,6 +1449,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCaps= DevicePropsVirtioSCSI[] =3D { }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVfioPCI[] = =3D { + { "vf-token", QEMU_CAPS_VFIO_VFTOKEN, NULL }, }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsSCSIDisk[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 3c4f7f625b..f97b1c9fd5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -677,6 +677,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 450 */ QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with = async-teardown=3Don|off */ QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA, /* virtio-blk-vhost-vdpa block= driver */ + QEMU_CAPS_VFIO_VFTOKEN, /* vf-token support */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_8.1.0_s390x.xml index 427ee9d5c7..f4a65a133f 100644 --- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml @@ -112,6 +112,7 @@ + 8000050 39100245 v8.0.0-1270-g1c12355b diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_8.1.0_x86_64.xml index d266dd0f31..202a2c7f8d 100644 --- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml @@ -198,6 +198,7 @@ + 8001000 43100245 v8.1.0 diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_8.2.0_x86_64.xml index ef3bd14597..24809ab70f 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml @@ -199,6 +199,7 @@ + 8001050 43100246 v8.1.0-3111-gad6ef0a42e --=20 2.33.8 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704202317717402.8027827652662; Tue, 2 Jan 2024 05:31:57 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9BEE41811; Tue, 2 Jan 2024 08:31:56 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 642CE17A6; Tue, 2 Jan 2024 08:26:18 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id B966C16F6; Tue, 2 Jan 2024 08:25:52 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 12E2B16EC for ; Tue, 2 Jan 2024 08:25:48 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:49 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:47 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950871" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950871" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201541" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201541" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 3/8] conf: Define PCI address vf-token extension Date: Tue, 2 Jan 2024 18:55:13 +0530 Message-Id: <20240102132518.297-4-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: OHNX7AC22GUTVTY5ADZ2B6OYL4F4RW4N X-Message-ID-Hash: OHNX7AC22GUTVTY5ADZ2B6OYL4F4RW4N X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202318184100001 This patch introduces the PCI address extension flag for vf-token Signed-off-by: Vivek Kashyap --- src/conf/domain_addr.h | 1 + src/qemu/qemu_domain_address.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index e72fb48847..29e7257177 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -29,6 +29,7 @@ typedef enum { VIR_PCI_ADDRESS_EXTENSION_NONE =3D 0, /* no extension */ VIR_PCI_ADDRESS_EXTENSION_ZPCI =3D 1 << 0, /* zPCI support */ + VIR_PCI_ADDRESS_EXTENSION_VFTOKEN =3D 1 << 1, /* VF token support */ } virPCIDeviceAddressExtensionFlags; =20 typedef enum { diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 099778b2a8..3be5acbc9e 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -575,6 +575,9 @@ qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQE= MUCaps *qemuCaps, extFlags |=3D VIR_PCI_ADDRESS_EXTENSION_ZPCI; } =20 + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_VFTOKEN)) + extFlags |=3D VIR_PCI_ADDRESS_EXTENSION_VFTOKEN; + return extFlags; } =20 --=20 2.33.8 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704202490568996.8938664257328; Tue, 2 Jan 2024 05:34:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 670C117A8; Tue, 2 Jan 2024 08:34:49 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EC0591734; Tue, 2 Jan 2024 08:26:59 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id C49B41788; Tue, 2 Jan 2024 08:26:36 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id F035916F1 for ; Tue, 2 Jan 2024 08:25:50 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:51 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:48 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950873" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950873" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201546" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201546" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 4/8] conf: XML parsing and formatting of vf-token Date: Tue, 2 Jan 2024 18:55:14 +0530 Message-Id: <20240102132518.297-5-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: ON3VLSLN7MSW4N4PTJ2MI5UM75MTYT7T X-Message-ID-Hash: ON3VLSLN7MSW4N4PTJ2MI5UM75MTYT7T X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202491150100001 This patch introduces new XML parser/formatter functions for parsing the vf-token Signed-off-by: Vivek Kashyap Signed-off-by: Ciara Loftus --- src/conf/device_conf.c | 49 ++++++++++++++++++++++++++++++++++------ src/conf/domain_conf.c | 8 +++++++ src/libvirt_private.syms | 1 + src/util/virpci.c | 7 ++++++ src/util/virpci.h | 2 ++ 5 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index f3d977f2b7..f490aeef9a 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -70,6 +70,21 @@ virZPCIDeviceAddressParseXML(xmlNodePtr node, return 0; } =20 + +static int +virPCIDeviceTokenParseXML(xmlNodePtr node, + virPCIDeviceAddress *addr) +{ + if (virXMLPropUUID(node, "uuid", VIR_XML_PROP_NONE, + addr->token.uuid) < 0) + return -1; + + addr->token.isSet =3D 1; + + return 0; +} + + void virDomainDeviceInfoClear(virDomainDeviceInfo *info) { @@ -200,6 +215,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, virPCIDeviceAddress *addr) { xmlNodePtr zpci; + xmlNodePtr token; =20 memset(addr, 0, sizeof(*addr)); =20 @@ -231,6 +247,11 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, return -1; } =20 + if ((token =3D virXMLNodeGetSubelement(node, "vf-token"))) { + if (virPCIDeviceTokenParseXML(token, addr) < 0) + return -1; + } + return 0; } =20 @@ -239,13 +260,27 @@ virPCIDeviceAddressFormat(virBuffer *buf, virPCIDeviceAddress addr, bool includeTypeInAddr) { - virBufferAsprintf(buf, "
\n", - includeTypeInAddr ? "type=3D'pci' " : "", - addr.domain, - addr.bus, - addr.slot, - addr.function); + g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) tokenBuf =3D VIR_BUFFER_INIT_CHILD(buf); + virBuffer *tb =3D NULL; + + virBufferAsprintf(&attrBuf, " %sdomain=3D'0x%04x' bus=3D'0x%02x' " + "slot=3D'0x%02x' function=3D'0x%d'", + includeTypeInAddr ? "type=3D'pci' " : "", + addr.domain, + addr.bus, + addr.slot, + addr.function); + + if (virPCIVFIOTokenIDIsPresent(&addr.token)) { + char uuidstr[VIR_UUID_STRING_BUFLEN]; + + virBufferAsprintf(&tokenBuf, "\n", + virUUIDFormat(addr.token.uuid, uuidstr)); + tb =3D &tokenBuf; + } + + virXMLFormatElement(buf, "address", &attrBuf, tb); } =20 int diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 22ad43e1d7..8bda81815a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5403,6 +5403,14 @@ virDomainDeviceInfoFormat(virBuffer *buf, info->addr.pci.zpci.uid.value, info->addr.pci.zpci.fid.value); } + + if (virPCIVFIOTokenIDIsPresent(&info->addr.pci.token)) { + char uuidstr[VIR_UUID_STRING_BUFLEN]; + + virBufferAsprintf(&childBuf, "\n", + virUUIDFormat(info->addr.pci.token.uuid, + uuidstr)); + } break; =20 case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE: diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 31c0f169c3..b2bc26c323 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3138,6 +3138,7 @@ virPCIHeaderTypeToString; virPCIIsVirtualFunction; virPCIStubDriverTypeFromString; virPCIStubDriverTypeToString; +virPCIVFIOTokenIDIsPresent; virPCIVirtualFunctionListFree; virZPCIDeviceAddressIsIncomplete; virZPCIDeviceAddressIsPresent; diff --git a/src/util/virpci.c b/src/util/virpci.c index afce7b52b7..0a9ae7a881 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2314,6 +2314,13 @@ virZPCIDeviceAddressIsPresent(const virZPCIDeviceAdd= ress *addr) } =20 =20 +bool +virPCIVFIOTokenIDIsPresent(const virPCIDeviceToken *token) +{ + return token->isSet; +} + + void virPCIVirtualFunctionListFree(virPCIVirtualFunctionList *list) { diff --git a/src/util/virpci.h b/src/util/virpci.h index da32c2f4d2..8510752e84 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -271,6 +271,8 @@ int virPCIDeviceAddressParse(char *address, virPCIDevic= eAddress *bdf); bool virZPCIDeviceAddressIsIncomplete(const virZPCIDeviceAddress *addr); bool virZPCIDeviceAddressIsPresent(const virZPCIDeviceAddress *addr); =20 +bool virPCIVFIOTokenIDIsPresent(const virPCIDeviceToken *token); + int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, int pfNetDevIdx, char **pfname, --=20 2.33.8 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704202401702109.7263909761025; Tue, 2 Jan 2024 05:33:21 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 8DBD717DA; Tue, 2 Jan 2024 08:33:20 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id ECBB7173A; Tue, 2 Jan 2024 08:26:48 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 976C016EB; Tue, 2 Jan 2024 08:26:35 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1E5E316F6 for ; Tue, 2 Jan 2024 08:25:53 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:53 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:50 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950875" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950875" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201558" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201558" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 5/8] qemu: Introduce validation for vf-token Date: Tue, 2 Jan 2024 18:55:15 +0530 Message-Id: <20240102132518.297-6-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: JAUOKHOD7AHBMGBSMOXY4CJS56JVBCYL X-Message-ID-Hash: JAUOKHOD7AHBMGBSMOXY4CJS56JVBCYL X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202402869100001 Introduce a validation function for vf-token support in qemu and generate vf-token device attribute in qemu command line Signed-off-by: Vivek Kashyap --- src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_validate.c | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 54fb8220e8..0e81a3ed73 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4706,6 +4706,7 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, virDomainNetTeamingInfo *teaming; g_autofree char *host =3D virPCIDeviceAddressAsString(&pcisrc->addr); const char *failover_pair_id =3D NULL; + g_autofree char *token =3D NULL; =20 /* caller has to assign proper passthrough backend type */ switch (pcisrc->backend) { @@ -4732,9 +4733,16 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, teaming->persistent) failover_pair_id =3D teaming->persistent; =20 + if ((dev->info->pciAddrExtFlags & VIR_PCI_ADDRESS_EXTENSION_VFTOKEN) && + pcisrc->addr.token.isSet) { + token =3D g_new0(char, VIR_UUID_STRING_BUFLEN); + virUUIDFormat(pcisrc->addr.token.uuid, token); + } + if (virJSONValueObjectAdd(&props, "s:driver", "vfio-pci", "s:host", host, + "S:vf-token", token, "s:id", dev->info->alias, "p:bootindex", dev->info->effectiveBootIndex, "S:failover_pair_id", failover_pair_id, diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e475ad035e..13114ca3d1 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1364,6 +1364,24 @@ qemuValidateDomainDeviceDefZPCIAddress(virDomainDevi= ceInfo *info, } =20 =20 +static int +qemuValidateDomainDeviceDefVFTokenId(virDomainDeviceInfo *info, + virQEMUCaps *qemuCaps) +{ + virPCIDeviceToken *vftoken =3D &info->addr.pci.token; + + if (virPCIVFIOTokenIDIsPresent(vftoken) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_VFTOKEN)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", + _("This QEMU binary doesn't support vf token ids")); + return -1; + } + + return 0; +} + + static int qemuValidateDomainDeviceDefAddressDrive(virDomainDeviceInfo *info, const virDomainDef *def, @@ -1483,6 +1501,8 @@ qemuValidateDomainDeviceDefAddress(const virDomainDev= iceDef *dev, case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: if (qemuValidateDomainDeviceDefZPCIAddress(info, qemuCaps) < 0) return -1; + if (qemuValidateDomainDeviceDefVFTokenId(info, qemuCaps) < 0) + return -1; break; =20 case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE: --=20 2.33.8 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704202597518846.1383305242907; Tue, 2 Jan 2024 05:36:37 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 38B0E1878; Tue, 2 Jan 2024 08:36:36 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2CCAC17C1; Tue, 2 Jan 2024 08:27:20 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 0AEF117B5; Tue, 2 Jan 2024 08:26:58 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id ED01E178D for ; Tue, 2 Jan 2024 08:25:57 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:55 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:52 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950879" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950879" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201565" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201565" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 6/8] docs: Update documentation and vf-token schema Date: Tue, 2 Jan 2024 18:55:16 +0530 Message-Id: <20240102132518.297-7-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: OTWIXFDUJNMRPMFQ7WJSONQKITGIMJW2 X-Message-ID-Hash: OTWIXFDUJNMRPMFQ7WJSONQKITGIMJW2 X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202597966100001 Provide information about the vf-token flag Signed-off-by: Vivek Kashyap --- docs/formatdomain.rst | 3 +++ src/conf/schemas/basictypes.rng | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 310d2bc427..29a7b3145e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3744,6 +3744,9 @@ control where on the bus the device will be placed: between 0x0001 and 0xffff, inclusive), and ``fid`` (a hex value between 0x00000000 and 0xffffffff, inclusive) used by PCI devices on S390 for User-defined Identifiers and Function Identifiers. + The ``vf-token`` element is supported in uuid format. The vf-token is a + shared secret between userspace vfio-pci PF driver and VF driver. The + token is set by the PF driver, and must be provided for VF access. :since:`Since 1.3.5` , some hypervisor drivers may accept an ``
`` element with no other attributes as an expl= icit request to assign a PCI address for the device rather than some other t= ype of diff --git a/src/conf/schemas/basictypes.rng b/src/conf/schemas/basictypes.= rng index 26eb538077..bbb7484430 100644 --- a/src/conf/schemas/basictypes.rng +++ b/src/conf/schemas/basictypes.rng @@ -121,6 +121,13 @@ + + + + + + + --=20 2.33.8 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Sat May 11 04:08:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704202706268107.59101149728087; Tue, 2 Jan 2024 05:38:26 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1847E178F; Tue, 2 Jan 2024 08:38:25 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6482217D6; Tue, 2 Jan 2024 08:27:24 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 800F017CE; Tue, 2 Jan 2024 08:27:02 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AF7001710 for ; Tue, 2 Jan 2024 08:25:59 -0500 (EST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:59 -0800 Received: from vivk-mobl.amr.corp.intel.com ([10.215.118.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 05:25:54 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="3950882" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="3950882" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="783201576" X-IronPort-AV: E=Sophos;i="6.04,325,1695711600"; d="scan'208";a="783201576" From: Vivek Kashyap To: devel@lists.libvirt.org Subject: [PATCH vf-token 7/8] test: add tests for the vf-token flag Date: Tue, 2 Jan 2024 18:55:17 +0530 Message-Id: <20240102132518.297-8-vivek.kashyap@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240102132518.297-1-vivek.kashyap@linux.intel.com> References: <20240102132518.297-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: YL6QLSRILHUG7BXIL6Q3W3BPVT47BZCF X-Message-ID-Hash: YL6QLSRILHUG7BXIL6Q3W3BPVT47BZCF X-MailFrom: vivek.kashyap@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: ciara.loftus@intel.com, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704202706682100001 Add tests for the vf-token flag to the qemuxml2argv and qemuxml2xml test suites Signed-off-by: Vivek Kashyap Signed-off-by: Ciara Loftus --- .../hostdev-vfio-vf-token.x86_64-latest.args | 34 ++++++++++++++++ .../hostdev-vfio-vf-token.xml | 22 ++++++++++ tests/qemuxml2argvtest.c | 1 + .../hostdev-vfio-vf-token.x86_64-latest.xml | 40 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 98 insertions(+) create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-vf-token.x86_64-lat= est.args create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-vf-token.xml create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-vf-token.x86_64-l= atest.xml diff --git a/tests/qemuxml2argvdata/hostdev-vfio-vf-token.x86_64-latest.arg= s b/tests/qemuxml2argvdata/hostdev-vfio-vf-token.x86_64-latest.args new file mode 100644 index 0000000000..e449c84ea9 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-vfio-vf-token.x86_64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"vfio-pci","host":"0000:00:00.0","vf-token":"00112233-4= 455-6677-8899-aabbccddeeff","id":"hostdev0","bus":"pci.0","addr":"0x8"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-vfio-vf-token.xml b/tests/qemux= ml2argvdata/hostdev-vfio-vf-token.xml new file mode 100644 index 0000000000..87dddd762a --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-vfio-vf-token.xml @@ -0,0 +1,22 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + + hvm + + + + /usr/bin/qemu-system-x86_64 + + + + +
+ +
+ +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b2ea2191dc..20bc914748 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1547,6 +1547,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("hostdev-pci-duplicate"); DO_TEST_CAPS_LATEST("hostdev-vfio"); DO_TEST_CAPS_LATEST("hostdev-vfio-multidomain"); + DO_TEST_CAPS_LATEST("hostdev-vfio-vf-token"); DO_TEST_CAPS_LATEST("hostdev-mdev-precreated"); DO_TEST_CAPS_LATEST_PARSE_ERROR("hostdev-mdev-src-address-invalid"); DO_TEST_CAPS_LATEST_PARSE_ERROR("hostdev-mdev-invalid-target-address"); diff --git a/tests/qemuxml2xmloutdata/hostdev-vfio-vf-token.x86_64-latest.x= ml b/tests/qemuxml2xmloutdata/hostdev-vfio-vf-token.x86_64-latest.xml new file mode 100644 index 0000000000..65c4fc6a4a --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-vfio-vf-token.x86_64-latest.xml @@ -0,0 +1,40 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + +