From nobody Sat Nov 23 02:58:07 2024 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=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1682332927; cv=none; d=zohomail.com; s=zohoarc; b=DmP32XHPJn9KZRa3daN5lVO28kmvm0dWvsaZvstb9sQ3QY43fbdccw+HxrQn76tx3mEBKTDDF0UvsDeHM+T6qbPHsXhh5eOKriD3+skGWbvmEeF8CAG/AcBCFbk+JU7tPR+DpJ6O9SmKIcSvC+U/NJXdCiIVJwA3GiHrds5BSnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682332927; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=NqhE+/4ttS8uCrkHIb/dM6n+rJcqW3SmxdUki7Q6MeA=; b=k6bitZ9zBf4GMWsZfKUXCfhLUyxeovvp3M0h42821cDI9980xRK7IhLgQx2HPFI3+Pw2WG/KdaSxT6vnJn9Uk+e5daM2UgDITxK/vnS1rPWfjzaX5utine4y7eyNyBg4OVwq6LrrIKBERySSYmiUOHG9reTAcu5NCzavh63HdWU= 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=fail header.from= (p=quarantine dis=quarantine) 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 168233292724652.16457055293472; Mon, 24 Apr 2023 03:42:07 -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-341--Y6R-jy2OdyXqieZZMecrQ-1; Mon, 24 Apr 2023 06:42:02 -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 0A51E29AA3AF; Mon, 24 Apr 2023 10:42:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8226492C18; Mon, 24 Apr 2023 10:41:59 +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 D243F1946589; Mon, 24 Apr 2023 10:41:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A14A1946586 for ; Mon, 24 Apr 2023 03:55:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B9C4014171B8; Mon, 24 Apr 2023 03:55:50 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B234F14171BA for ; Mon, 24 Apr 2023 03:55:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 D4CD72A59550 for ; Mon, 24 Apr 2023 03:55:49 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-58TPottTM72ADrfaYI4s1g-1; Sun, 23 Apr 2023 23:55:44 -0400 Received: from kwepemi500005.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Q4W0r55r3zSqwG; Mon, 24 Apr 2023 11:32:44 +0800 (CST) Received: from 90030.china.huawei.com (10.174.184.109) by kwepemi500005.china.huawei.com (7.221.188.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 24 Apr 2023 11:36:57 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682332926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NqhE+/4ttS8uCrkHIb/dM6n+rJcqW3SmxdUki7Q6MeA=; b=EIJJIpkWbZECWMWqmVcXpWeiJsC5htSjeJOn+/We7TpcEXpSYN0Yt/Cu9Bt2ufauRF28AC HzW7X7w1iJtPRfjb/pAF6snlrUe4N8QDfiQsAHSmBVb7pu0QcVu7PqcgGJa5gX1qj4kLfu rzdjau6sCOOcHZbgPjPy8kabsEqTgok= X-MC-Unique: -Y6R-jy2OdyXqieZZMecrQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 58TPottTM72ADrfaYI4s1g-1 From: libai To: Subject: [PATCH] hostdev:Introduce vDPA device to hostdev subsystem as a new subtype Date: Mon, 24 Apr 2023 11:36:07 +0800 Message-ID: <20230424033607.16356-1-libai12@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.184.109] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500005.china.huawei.com (7.221.188.179) X-CFilter-Loop: Reflected 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 3.1 on 10.11.54.7 X-Mailman-Approved-At: Mon, 24 Apr 2023 10:41:58 +0000 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: , Cc: jiangdongxu1@huawei.com, jasowang@redhat.com, fangyi@huawei.com, wanghao232@huawei.com, libai 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: huawei.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682332927612100015 Content-Type: text/plain; charset="utf-8" The following is the xml of vdpa device: And the command line passed to QEMU is as follows: -device {"driver":"vhost-vdpa-device-pci","vhostdev":"/dev/vhost-vdpa-0"} This solution is selected according to the previous discussion on the solution of supporting the vDPA device. For details, see the following: https://listman.redhat.com/archives/libvir-list/2023-March/239018.html Signed-off-by: libai --- src/conf/domain_audit.c | 4 +++ src/conf/domain_conf.c | 47 +++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 6 +++++ src/conf/domain_validate.c | 1 + src/conf/virconftypes.h | 2 ++ src/qemu/qemu_command.c | 19 +++++++++++++ src/qemu/qemu_command.h | 3 +++ src/qemu/qemu_domain.c | 6 +++++ src/qemu/qemu_hotplug.c | 1 + src/qemu/qemu_migration.c | 2 ++ src/qemu/qemu_validate.c | 2 ++ src/security/security_dac.c | 2 ++ src/security/security_selinux.c | 2 ++ 13 files changed, 97 insertions(+) diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index ae875188bd..6906ce7ade 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -344,6 +344,7 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostde= vDef *hostdev, virDomainHostdevSubsysSCSI *scsisrc =3D &hostdev->source.subsys.u.scsi; virDomainHostdevSubsysSCSIVHost *hostsrc =3D &hostdev->source.subsys.u= .scsi_host; virDomainHostdevSubsysMediatedDev *mdevsrc =3D &hostdev->source.subsys= .u.mdev; + virDomainHostdevSubsysVDPA *vdpasrc =3D &hostdev->source.subsys.u.vdpa; =20 virUUIDFormat(vm->def->uuid, uuidstr); if (!(vmname =3D virAuditEncode("vm", vm->def->name))) { @@ -383,6 +384,9 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostde= vDef *hostdev, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: address =3D g_strdup(mdevsrc->uuidstr); break; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + address =3D g_strdup(vdpasrc->devpath); + break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: default: VIR_WARN("Unexpected hostdev type while encoding audit message= : %d", diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b03a3ff011..e8f6d1457b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1047,6 +1047,7 @@ VIR_ENUM_IMPL(virDomainHostdevSubsys, "scsi", "scsi_host", "mdev", + "vdpa", ); =20 VIR_ENUM_IMPL(virDomainHostdevSubsysPCIBackend, @@ -2641,6 +2642,9 @@ virDomainHostdevDefClear(virDomainHostdevDef *def) case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: g_clear_pointer(&def->source.subsys.u.pci.origstates, virBitma= pFree); break; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + VIR_FREE(def->source.subsys.u.vdpa.devpath); + break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: @@ -6160,6 +6164,22 @@ virDomainHostdevSubsysMediatedDevDefParseXML(virDoma= inHostdevDef *def, return 0; } =20 +static int +virDomainHostdevSubsysVDPADefParseXML(xmlNodePtr sourcenode, + virDomainHostdevDef *def) +{ + g_autofree char *devpath =3D NULL; + virDomainHostdevSubsysVDPA *vdpa =3D &def->source.subsys.u.vdpa; + + if(!(devpath =3D virXMLPropString(sourcenode, "dev"))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Missing 'dev' attribute for element ")); + return -1; + } + vdpa->devpath =3D g_steal_pointer(&devpath); + return 0; +} + static int virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, xmlXPathContextPtr ctxt, @@ -6317,6 +6337,11 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, if (virDomainHostdevSubsysMediatedDevDefParseXML(def, ctxt) < 0) return -1; break; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + if (virDomainHostdevSubsysVDPADefParseXML(sourcenode, def) < 0) { + return -1; + } + break; =20 default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -12979,6 +13004,7 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xml= opt, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: break; } @@ -14101,6 +14127,13 @@ virDomainHostdevMatchSubsys(virDomainHostdevDef *a, return 0; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: return virDomainHostdevMatchSubsysMediatedDev(a, b); + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + if (STREQ(a->source.subsys.u.vdpa.devpath, + b->source.subsys.u.vdpa.devpath)) { + return 1; + } else { + return 0; + } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: return 0; } @@ -23290,6 +23323,16 @@ virDomainHostdevDefFormatSubsysMdev(virBuffer *buf, virXMLFormatElement(buf, "source", NULL, &sourceChildBuf); } =20 +static void +virDomainHostdevDefFormatSubsysVDPA(virBuffer *buf, + virDomainHostdevDef *def) +{ + g_auto(virBuffer) sourceAttrBuf =3D VIR_BUFFER_INITIALIZER; + virDomainHostdevSubsysVDPA *vdpasrc =3D &def->source.subsys.u.vdpa; + virBufferAsprintf(&sourceAttrBuf, " dev=3D'%s'", vdpasrc->devpath); + virXMLFormatElement(buf, "source", &sourceAttrBuf, NULL); +} + =20 static int virDomainHostdevDefFormatSubsys(virBuffer *buf, @@ -23317,6 +23360,10 @@ virDomainHostdevDefFormatSubsys(virBuffer *buf, virDomainHostdevDefFormatSubsysMdev(buf, def); return 0; =20 + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + virDomainHostdevDefFormatSubsysVDPA(buf, def); + return 0; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: default: virReportEnumRangeError(virDomainHostdevSubsysType, def->source.su= bsys.type); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 511067a050..ade8b0edec 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -197,6 +197,7 @@ typedef enum { VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV, + VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA, =20 VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST } virDomainHostdevSubsysType; @@ -289,6 +290,10 @@ struct _virDomainHostdevSubsysMediatedDev { virTristateSwitch ramfb; }; =20 +struct _virDomainHostdevSubsysVDPA { + char *devpath; /* vDPA device path */ +}; + typedef enum { VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_NONE, VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_VHOST, @@ -323,6 +328,7 @@ struct _virDomainHostdevSubsys { virDomainHostdevSubsysSCSI scsi; virDomainHostdevSubsysSCSIVHost scsi_host; virDomainHostdevSubsysMediatedDev mdev; + virDomainHostdevSubsysVDPA vdpa; } u; }; =20 diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index e04b85fee4..4af84c4f0c 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2214,6 +2214,7 @@ virDomainHostdevDefValidate(const virDomainHostdevDef= *hostdev) } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: break; } diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index e07f967814..1756c54e7a 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -120,6 +120,8 @@ typedef struct _virDomainHostdevSubsys virDomainHostdev= Subsys; =20 typedef struct _virDomainHostdevSubsysMediatedDev virDomainHostdevSubsysMe= diatedDev; =20 +typedef struct _virDomainHostdevSubsysVDPA virDomainHostdevSubsysVDPA; + typedef struct _virDomainHostdevSubsysPCI virDomainHostdevSubsysPCI; =20 typedef struct _virDomainHostdevSubsysSCSI virDomainHostdevSubsysSCSI; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ca93bf3dc..121214f4d5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4958,6 +4958,18 @@ qemuBuildHostdevMediatedDevProps(const virDomainDef = *def, return g_steal_pointer(&props); } =20 +virJSONValue * +qemuBuildHostdevVDPADevProps(virDomainHostdevDef *dev) +{ + g_autoptr(virJSONValue) props =3D NULL; + virDomainHostdevSubsysVDPA *vdpasrc =3D &dev->source.subsys.u.vdpa; + if (virJSONValueObjectAdd(&props, + "s:driver", "vhost-vdpa-device-pci", + "s:vhostdev", vdpasrc->devpath, + NULL) < 0) + return NULL; + return g_steal_pointer(&props); +} =20 qemuBlockStorageSourceAttachData * qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef *hostdev, @@ -5154,6 +5166,13 @@ qemuBuildHostdevCommandLine(virCommand *cmd, return -1; break; =20 + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + if (!(devprops =3D qemuBuildHostdevVDPADevProps(hostdev))) + return -1; + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qem= uCaps) < 0) + return -1; + break; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: break; } diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 5fdb138030..dff18350b5 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -198,6 +198,9 @@ virJSONValue * qemuBuildHostdevMediatedDevProps(const virDomainDef *def, virDomainHostdevDef *dev); =20 +virJSONValue * +qemuBuildHostdevVDPADevProps(virDomainHostdevDef *dev); + virJSONValue * qemuBuildRedirdevDevProps(const virDomainDef *def, virDomainRedirdevDef *dev); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 63b13b6875..0cd485a459 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10533,6 +10533,8 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev, virDomainHostdevSubsysSCSI *scsisrc =3D &dev->source.subsys.u.scsi; virDomainHostdevSubsysSCSIVHost *hostsrc =3D &dev->source.subsys.u.scs= i_host; virDomainHostdevSubsysMediatedDev *mdevsrc =3D &dev->source.subsys.u.m= dev; + virDomainHostdevSubsysVDPA *vdpasrc =3D &dev->source.subsys.u.vdpa; + g_autoptr(virUSBDevice) usb =3D NULL; g_autoptr(virSCSIDevice) scsi =3D NULL; g_autoptr(virSCSIVHostDevice) host =3D NULL; @@ -10603,6 +10605,10 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev, if (!(tmpPath =3D virMediatedDeviceGetIOMMUGroupDev(mdevsrc->u= uidstr))) return -1; =20 + perm =3D VIR_CGROUP_DEVICE_RW; + break; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + tmpPath =3D g_strdup(vdpasrc->devpath); perm =3D VIR_CGROUP_DEVICE_RW; break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5072798cb7..7d89899223 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4546,6 +4546,7 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: qemuDomainRemoveMediatedDevice(driver, vm, hostdev); break; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: break; } diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ed41a03851..9220ef1ab1 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1295,6 +1295,8 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *= def) case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: + /* The vDPA devices don't support migration for now */ + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("cannot migrate a domain with "), virDomainHostdevSubsysTypeToString(hostdev-= >source.subsys.type)); diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b8d5e9bd74..ea3d4e1a39 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2566,6 +2566,8 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHos= tdevDef *hostdev, break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: return qemuValidateDomainMdevDef(hostdev, def, qemuCaps); + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: + break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: default: virReportEnumRangeError(virDomainHostdevSubsysType, diff --git a/src/security/security_dac.c b/src/security/security_dac.c index c7dc145621..24f3de5d15 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1313,6 +1313,7 @@ virSecurityDACSetHostdevLabel(virSecurityManager *mgr, break; } =20 + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: ret =3D 0; break; @@ -1469,6 +1470,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManager = *mgr, break; } =20 + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: ret =3D 0; break; diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index e3e6a6115f..5cb6612fbc 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -2265,6 +2265,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nager *mgr, break; } =20 + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: ret =3D 0; break; @@ -2493,6 +2494,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManager *mgr, break; } =20 + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: ret =3D 0; break; --=20 2.33.0