From nobody Mon Feb 9 09:33:03 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=1698036974; cv=none; d=zohomail.com; s=zohoarc; b=Wplh/zMj77ijOuSik8HgX5QkbYOGxD1agjRCMgf9U2jLkjb9OHLgvV8bWaQMKF3ARXyaa/xYu4Jb2i42SxwFqJnhuMGH48egfuYwaskViLYI9JDbwmjv24TqBOGiE/VF4vlHsvGDYzUy4demOufTRO9QvdW4UBjKrpDv7g74Cgg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698036974; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Kx4A1JjIwwVIdWY9imvsrDqmddsinPkWb1K1qsEtHLQ=; b=gOptOryEBl7/+ibhFqpPAtYZ07WhyhRy80GEQd+KcscFKEesPg5iQAaeH/YmwDNyK4qiV69lFSSVGqh8nQjw5gPavtVilPh5dJfUrcr6A2EQxymayIjutJaZ7cacIPJcMGg7DHqnuo3XRUzoP2wbKqXZq18hJjmQ1CKPTGl5pEE= 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 1698036974383317.00146385588243; Sun, 22 Oct 2023 21:56:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.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-696-dpCTGdkLNkSpG3m9e68OzQ-1; Mon, 23 Oct 2023 00:55:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 1C7A5382333F; Mon, 23 Oct 2023 04:55: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 EC4A9111D7A1; Mon, 23 Oct 2023 04:54: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 D4CD419466E6; Mon, 23 Oct 2023 04:54:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8BBEF1946597 for ; Mon, 23 Oct 2023 04:54:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6C361C1596D; Mon, 23 Oct 2023 04:54:53 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.8.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 359EBC15BB8; Mon, 23 Oct 2023 04:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698036973; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Kx4A1JjIwwVIdWY9imvsrDqmddsinPkWb1K1qsEtHLQ=; b=Y9VBINq2Qh67lpV9kyXGjomc49M3JIqL3w1oRbluUzC//sLXPb9GDQZpZXId2aZdZTpsYC PAsjQ7YNxCa0gLEwTn3jCHLKQEJSrpPCAVnIbubzEGqSxUTXz7oPE+AQukcLzKhczpY6w0 Ly4yFyXdrmqVBr0DMCKzZ3d1grgM2JU= X-MC-Unique: dpCTGdkLNkSpG3m9e68OzQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 05/15] conf: put hostdev PCI backend into a struct Date: Mon, 23 Oct 2023 00:54:41 -0400 Message-ID: <20231023045451.210711-6-laine@redhat.com> In-Reply-To: <20231023045451.210711-1-laine@redhat.com> References: <20231023045451.210711-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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: Joao Martins , Cedric Le Goater , Jason Gunthorpe Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.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: 1698036975525100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The new struct is virDeviceHostdevPCIDriverInfo, and the "backend" enum in the hostdevDef will be replaced with a virDeviceHostdevPCIDriverInfo named "driver'. Since the enum value in this new struct is called "type", it means that all references to "backend" will become "driver.type". This will allow easily adding other items for new attributes in the element / C struct, which will be useful once we are using this new struct in multiple places. Signed-off-by: Laine Stump --- src/conf/device_conf.h | 4 ++++ src/conf/domain_conf.c | 32 ++++++++++++++------------------ src/conf/domain_conf.h | 2 +- src/conf/virconftypes.h | 2 ++ src/hypervisor/virhostdev.c | 6 +++--- src/libxl/libxl_domain.c | 6 +++--- src/libxl/libxl_driver.c | 6 +++--- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_validate.c | 6 +++--- src/security/security_apparmor.c | 2 +- src/security/security_dac.c | 4 ++-- src/security/security_selinux.c | 4 ++-- src/security/virt-aa-helper.c | 2 +- tests/virhostdevtest.c | 2 +- 15 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 7513beb5e1..3a7a6c3f99 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -43,6 +43,10 @@ typedef enum { =20 VIR_ENUM_DECL(virDeviceHostdevPCIDriver); =20 +struct _virDeviceHostdevPCIDriverInfo { + virDeviceHostdevPCIDriverType type; +}; + typedef enum { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE =3D 0, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI, diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6dde17ded3..e840244a7d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6271,7 +6271,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, if (virXMLPropEnum(driver_node, "name", virDeviceHostdevPCIDriverTypeFromString, VIR_XML_PROP_NONZERO, - &pcisrc->backend) < 0) { + &pcisrc->driver.type) < 0) { return -1; } } @@ -23333,18 +23333,18 @@ virDomainHostdevDefFormatSubsysPCI(virBuffer *buf, g_auto(virBuffer) sourceChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); virDomainHostdevSubsysPCI *pcisrc =3D &def->source.subsys.u.pci; =20 - if (pcisrc->backend !=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_DEFAULT) { - const char *backend - =3D virDeviceHostdevPCIDriverTypeToString(pcisrc->backend); + if (pcisrc->driver.type !=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_DEFAUL= T) { + const char *driverType + =3D virDeviceHostdevPCIDriverTypeToString(pcisrc->driver.type); =20 - if (!backend) { + if (!driverType) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected pci hostdev driver name type %1$d= "), - pcisrc->backend); + _("unexpected pci hostdev driver type %1$d"), + pcisrc->driver.type); return -1; } =20 - virBufferAsprintf(&driverAttrBuf, " name=3D'%s'", backend); + virBufferAsprintf(&driverAttrBuf, " name=3D'%s'", driverType); } =20 virXMLFormatElement(buf, "driver", &driverAttrBuf, NULL); @@ -29838,17 +29838,17 @@ virDomainNetDefActualFromNetworkPort(virDomainNet= Def *iface, actual->data.hostdev.def.source.subsys.u.pci.addr =3D port->plug.h= ostdevpci.addr; switch ((virNetworkForwardDriverNameType)port->plug.hostdevpci.dri= ver) { case VIR_NETWORK_FORWARD_DRIVER_NAME_DEFAULT: - actual->data.hostdev.def.source.subsys.u.pci.backend =3D + actual->data.hostdev.def.source.subsys.u.pci.driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_DEFAULT; break; =20 case VIR_NETWORK_FORWARD_DRIVER_NAME_KVM: - actual->data.hostdev.def.source.subsys.u.pci.backend =3D + actual->data.hostdev.def.source.subsys.u.pci.driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_KVM; break; =20 case VIR_NETWORK_FORWARD_DRIVER_NAME_VFIO: - actual->data.hostdev.def.source.subsys.u.pci.backend =3D + actual->data.hostdev.def.source.subsys.u.pci.driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO; break; =20 @@ -29959,7 +29959,7 @@ virDomainNetDefActualToNetworkPort(virDomainDef *do= m, } port->plug.hostdevpci.managed =3D virTristateBoolFromBool(actual->= data.hostdev.def.managed); port->plug.hostdevpci.addr =3D actual->data.hostdev.def.source.sub= sys.u.pci.addr; - switch (actual->data.hostdev.def.source.subsys.u.pci.backend) { + switch (actual->data.hostdev.def.source.subsys.u.pci.driver.type) { case VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_DEFAULT: port->plug.hostdevpci.driver =3D VIR_NETWORK_FORWARD_DRIVER_NA= ME_DEFAULT; break; @@ -29973,14 +29973,10 @@ virDomainNetDefActualToNetworkPort(virDomainDef *= dom, break; =20 case VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_XEN: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Unexpected PCI backend 'xen'")); - break; - case VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_LAST: default: virReportEnumRangeError(virDeviceHostdevPCIDriverType, - actual->data.hostdev.def.source.subsys= .u.pci.backend); + actual->data.hostdev.def.source.subsys= .u.pci.driver.type); return NULL; } =20 @@ -30924,7 +30920,7 @@ virHostdevIsVFIODevice(const virDomainHostdevDef *h= ostdev) { return hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type =3D=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_= PCI && - hostdev->source.subsys.u.pci.backend =3D=3D VIR_DEVICE_HOSTDEV_PCI= _DRIVER_TYPE_VFIO; + hostdev->source.subsys.u.pci.driver.type =3D=3D VIR_DEVICE_HOSTDEV= _PCI_DRIVER_TYPE_VFIO; } =20 =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index d56ed32a69..cb37fc9888 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -235,7 +235,7 @@ struct _virDomainHostdevSubsysUSB { =20 struct _virDomainHostdevSubsysPCI { virPCIDeviceAddress addr; /* host address */ - virDeviceHostdevPCIDriverType backend; + virDeviceHostdevPCIDriverInfo driver; =20 virBitmap *origstates; }; diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index e07f967814..d151dd134a 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -66,6 +66,8 @@ typedef struct _virCapsHostSecModelLabel virCapsHostSecMo= delLabel; =20 typedef struct _virCapsStoragePool virCapsStoragePool; =20 +typedef struct _virDeviceHostdevPCIDriverInfo virDeviceHostdevPCIDriverInf= o; + typedef struct _virDomainABIStability virDomainABIStability; =20 typedef struct _virDomainActualNetDef virDomainActualNetDef; diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c index ce7189ffcd..a33b3b604f 100644 --- a/src/hypervisor/virhostdev.c +++ b/src/hypervisor/virhostdev.c @@ -243,14 +243,14 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef = *hostdev, =20 virPCIDeviceSetManaged(actual, hostdev->managed); =20 - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO) { + if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO= ) { virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO); - } else if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_X= EN) { + } else if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TY= PE_XEN) { virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_XEN); } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("pci backend driver type '%1$s' is not supported"= ), - virDeviceHostdevPCIDriverTypeToString(pcisrc->backe= nd)); + virDeviceHostdevPCIDriverTypeToString(pcisrc->drive= r.type)); return -1; } =20 diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 904f40914c..22482adfa6 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -160,8 +160,8 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDef *dev, =20 if (hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type =3D=3D VIR_DOMAIN_HOSTDEV_SUBSYS_T= YPE_PCI && - pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_DEFA= ULT) - pcisrc->backend =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_XEN; + pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_= DEFAULT) + pcisrc->driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_XEN; } =20 if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO) { @@ -997,7 +997,7 @@ libxlNetworkPrepareDevices(virDomainDef *def) =20 if (hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type =3D=3D VIR_DOMAIN_HOSTDEV_SUBS= YS_TYPE_PCI) - pcisrc->backend =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_XEN; + pcisrc->driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE= _XEN; =20 if (virDomainHostdevInsert(def, hostdev) < 0) return -1; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index d04ec7f6ea..7f12b11b8d 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -3397,13 +3397,13 @@ libxlDomainAttachNetDevice(libxlDriverPrivate *driv= er, virDomainHostdevDef *hostdev =3D virDomainNetGetActualHostdev(net); virDomainHostdevSubsysPCI *pcisrc =3D &hostdev->source.subsys.u.pc= i; =20 - /* For those just allocated from a network pool whose backend is + /* For those just allocated from a network pool whose driver type = is * still VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_DEFAULT, we need to set - * backend correctly. + * driver type correctly. */ if (hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type =3D=3D VIR_DOMAIN_HOSTDEV_SUBSYS_T= YPE_PCI) - pcisrc->backend =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_XEN; + pcisrc->driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_XEN; =20 /* This is really a "smart hostdev", so it should be attached * as a hostdev (the hostdev code will reach over into the diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fcb4e31502..b23720922a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4731,7 +4731,7 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, const char *failover_pair_id =3D NULL; =20 /* caller has to assign proper passthrough backend type */ - switch (pcisrc->backend) { + switch (pcisrc->driver.type) { case VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO: break; =20 @@ -4741,7 +4741,7 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, case VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_LAST: virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid PCI passthrough type '%1$s'"), - virDeviceHostdevPCIDriverTypeToString(pcisrc->backe= nd)); + virDeviceHostdevPCIDriverTypeToString(pcisrc->drive= r.type)); return NULL; } =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d57932b681..b74e48d6f3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10568,7 +10568,7 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev, case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: switch (dev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_= VFIO) { + if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_T= YPE_VFIO) { if (!(tmpPath =3D virPCIDeviceAddressGetIOMMUGroupDev(&pci= src->addr))) return -1; =20 @@ -11333,7 +11333,7 @@ qemuDomainPrepareHostdevPCI(virDomainHostdevDef *ho= stdev, { bool supportsPassthroughVFIO =3D qemuHostdevHostSupportsPassthroughVFI= O(); virDeviceHostdevPCIDriverType *driverType - =3D &hostdev->source.subsys.u.pci.backend; + =3D &hostdev->source.subsys.u.pci.driver.type; =20 /* assign defaults for hostdev passthrough */ switch (*driverType) { diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 83365f6685..d958d01638 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2437,7 +2437,7 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHos= tdevDef *hostdev, const virDomainDef *def, virQEMUCaps *qemuCaps) { - int backend; + virDeviceHostdevPCIDriverType driverType; =20 /* forbid capabilities mode hostdev in this kind of hypervisor */ if (hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { @@ -2462,9 +2462,9 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHos= tdevDef *hostdev, break; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - backend =3D hostdev->source.subsys.u.pci.backend; + driverType =3D hostdev->source.subsys.u.pci.driver.type; =20 - if (backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO) { + if (driverType =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO)= { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("VFIO PCI device assignment is not su= pported by this version of qemu")); diff --git a/src/security/security_apparmor.c b/src/security/security_appar= mor.c index 515d68ec6b..9e1adcee69 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -869,7 +869,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManager *mgr, if (!pci) goto done; =20 - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO= ) { + if (pcisrc->driverType =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_V= FIO) { char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev(pci); =20 if (!vfioGroupDev) { diff --git a/src/security/security_dac.c b/src/security/security_dac.c index ff28e17136..31997474a4 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1257,7 +1257,7 @@ virSecurityDACSetHostdevLabel(virSecurityManager *mgr, if (!pci) return -1; =20 - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO= ) { + if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_= VFIO) { g_autofree char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev= (pci); =20 if (!vfioGroupDev) @@ -1418,7 +1418,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManager = *mgr, if (!pci) return -1; =20 - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO= ) { + if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_= VFIO) { g_autofree char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev= (pci); =20 if (!vfioGroupDev) diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index 89ceaf48d7..9a65c3a9f1 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -2201,7 +2201,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nager *mgr, if (!pci) return -1; =20 - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO= ) { + if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_= VFIO) { g_autofree char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev= (pci); =20 if (!vfioGroupDev) @@ -2437,7 +2437,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManager *mgr, if (!pci) return -1; =20 - if (pcisrc->backend =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO= ) { + if (pcisrc->driver.type =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_= VFIO) { g_autofree char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev= (pci); =20 if (!vfioGroupDev) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index ac4225a783..1964380e47 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1093,7 +1093,7 @@ get_files(vahControl * ctl) virPCIDevice *pci =3D virPCIDeviceNew(&dev->source.subsys.= u.pci.addr); =20 virDeviceHostdevPCIDriverType driverType - =3D dev->source.subsys.u.pci.backend; + =3D dev->source.subsys.u.pci.driverType; =20 if (driverType =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_V= FIO || driverType =3D=3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_D= EFAULT) { diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index d9ff992e91..e375fb2833 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -134,7 +134,7 @@ myInit(void) subsys->u.pci.addr.bus =3D 0; subsys->u.pci.addr.slot =3D i + 1; subsys->u.pci.addr.function =3D 0; - subsys->u.pci.backend =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_VFIO; + subsys->u.pci.driver.type =3D VIR_DEVICE_HOSTDEV_PCI_DRIVER_TYPE_V= FIO; } =20 for (i =3D 0; i < nhostdevs; i++) { --=20 2.41.0