提交 882fd7a1 编写于 作者: E Erik Skultety

conf: Replace usage of virNodeDevCapMdevType with virMediatedDeviceType

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: NErik Skultety <eskultet@redhat.com>
上级 3cbac4de
......@@ -91,19 +91,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)
{
......@@ -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:
......
......@@ -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 | \
......
......@@ -695,7 +695,6 @@ virNetDevIPRouteParseXML;
# conf/node_device_conf.h
virNodeDevCapMdevTypeFree;
virNodeDevCapsDefFree;
virNodeDevCapTypeFromString;
virNodeDevCapTypeToString;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册