From nobody Thu May 15 04:06:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516872623022432.2997866076014; Thu, 25 Jan 2018 01:30:23 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72AE9A452D; Thu, 25 Jan 2018 09:30:21 +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 1F2B0600D1; Thu, 25 Jan 2018 09:30:21 +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 1BB503FB19; Thu, 25 Jan 2018 09:30:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0P9QpXq001037 for ; Thu, 25 Jan 2018 04:26:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id 508092C317; Thu, 25 Jan 2018 09:26:51 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 548152C31E; Thu, 25 Jan 2018 09:26:36 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Thu, 25 Jan 2018 10:24:01 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH 14/15] conf: Replace usage of virNodeDevCapMdevType with virMediatedDeviceType 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 25 Jan 2018 09:30:22 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now that we have all the building blocks in place, switch the nodedev driver to use the "new" virMediatedDeviceType type instead of the "old" virNodeDevCapMdevType one. Signed-off-by: Erik Skultety --- src/conf/node_device_conf.c | 21 ++++----------------- src/conf/node_device_conf.h | 14 +------------- src/libvirt_private.syms | 1 - 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 3aefc9e5b..5fc5f6708 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -92,19 +92,6 @@ virNodeDevCapsDefParseString(const char *xpath, =20 =20 void -virNodeDevCapMdevTypeFree(virNodeDevCapMdevTypePtr type) -{ - if (!type) - return; - - VIR_FREE(type->id); - VIR_FREE(type->name); - VIR_FREE(type->device_api); - VIR_FREE(type); -} - - -void virNodeDeviceDefFree(virNodeDeviceDefPtr def) { virNodeDevCapsDefPtr caps; @@ -285,7 +272,7 @@ virNodeDeviceCapPCIDefFormat(virBufferPtr buf, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); for (i =3D 0; i < data->pci_dev.nmdev_types; i++) { - virNodeDevCapMdevTypePtr type =3D data->pci_dev.mdev_types[i]; + virMediatedDeviceTypePtr type =3D data->pci_dev.mdev_types[i]; virBufferEscapeString(buf, "\n", type->id); virBufferAdjustIndent(buf, 2); if (type->name) @@ -1546,7 +1533,7 @@ virNodeDevPCICapMdevTypesParseXML(xmlXPathContextPtr = ctxt, xmlNodePtr orignode =3D NULL; xmlNodePtr *nodes =3D NULL; int nmdev_types =3D -1; - virNodeDevCapMdevTypePtr type =3D NULL; + virMediatedDeviceTypePtr type =3D NULL; size_t i; =20 if ((nmdev_types =3D virXPathNodeSet("./type", ctxt, &nodes)) < 0) @@ -1593,7 +1580,7 @@ virNodeDevPCICapMdevTypesParseXML(xmlXPathContextPtr = ctxt, ret =3D 0; cleanup: VIR_FREE(nodes); - virNodeDevCapMdevTypeFree(type); + virMediatedDeviceTypeFree(type); ctxt->node =3D orignode; return ret; } @@ -2176,7 +2163,7 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) VIR_FREE(data->pci_dev.iommuGroupDevices); virPCIEDeviceInfoFree(data->pci_dev.pci_express); for (i =3D 0; i < data->pci_dev.nmdev_types; i++) - virNodeDevCapMdevTypeFree(data->pci_dev.mdev_types[i]); + virMediatedDeviceTypeFree(data->pci_dev.mdev_types[i]); VIR_FREE(data->pci_dev.mdev_types); break; case VIR_NODE_DEV_CAP_USB_DEV: diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 53cdfdb01..685ae3034 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -139,15 +139,6 @@ struct _virNodeDevCapSystem { virNodeDevCapSystemFirmware firmware; }; =20 -typedef struct _virNodeDevCapMdevType virNodeDevCapMdevType; -typedef virNodeDevCapMdevType *virNodeDevCapMdevTypePtr; -struct _virNodeDevCapMdevType { - char *id; - char *name; - char *device_api; - unsigned int available_instances; -}; - typedef struct _virNodeDevCapMdev virNodeDevCapMdev; typedef virNodeDevCapMdev *virNodeDevCapMdevPtr; struct _virNodeDevCapMdev { @@ -178,7 +169,7 @@ struct _virNodeDevCapPCIDev { int numa_node; virPCIEDeviceInfoPtr pci_express; int hdrType; /* enum virPCIHeaderType or -1 */ - virNodeDevCapMdevTypePtr *mdev_types; + virMediatedDeviceTypePtr *mdev_types; size_t nmdev_types; }; =20 @@ -358,9 +349,6 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def); void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); =20 -void -virNodeDevCapMdevTypeFree(virNodeDevCapMdevTypePtr type); - # define VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP \ (VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV | \ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8d4c8dd3f..2e20304ad 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -695,7 +695,6 @@ virNetDevIPRouteParseXML; =20 =20 # conf/node_device_conf.h -virNodeDevCapMdevTypeFree; virNodeDevCapsDefFree; virNodeDevCapTypeFromString; virNodeDevCapTypeToString; --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list