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 <eskultet@xxxxxxxxxx> --- 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, 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, "<capability type='mdev_types'>\n"); virBufferAdjustIndent(buf, 2); for (i = 0; i < data->pci_dev.nmdev_types; i++) { - virNodeDevCapMdevTypePtr type = data->pci_dev.mdev_types[i]; + virMediatedDeviceTypePtr type = data->pci_dev.mdev_types[i]; virBufferEscapeString(buf, "<type id='%s'>\n", type->id); virBufferAdjustIndent(buf, 2); if (type->name) @@ -1546,7 +1533,7 @@ virNodeDevPCICapMdevTypesParseXML(xmlXPathContextPtr ctxt, xmlNodePtr orignode = NULL; xmlNodePtr *nodes = NULL; int nmdev_types = -1; - virNodeDevCapMdevTypePtr type = NULL; + virMediatedDeviceTypePtr type = NULL; size_t i; if ((nmdev_types = virXPathNodeSet("./type", ctxt, &nodes)) < 0) @@ -1593,7 +1580,7 @@ virNodeDevPCICapMdevTypesParseXML(xmlXPathContextPtr ctxt, ret = 0; cleanup: VIR_FREE(nodes); - virNodeDevCapMdevTypeFree(type); + virMediatedDeviceTypeFree(type); ctxt->node = orignode; return ret; } @@ -2176,7 +2163,7 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) VIR_FREE(data->pci_dev.iommuGroupDevices); virPCIEDeviceInfoFree(data->pci_dev.pci_express); for (i = 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; }; -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; }; @@ -358,9 +349,6 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def); void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); -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; # conf/node_device_conf.h -virNodeDevCapMdevTypeFree; virNodeDevCapsDefFree; virNodeDevCapTypeFromString; virNodeDevCapTypeToString; -- 2.13.6 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list