提交 c3faa92a 编写于 作者: E Erik Skultety

util: mdev: Introduce virMediatedDeviceType structure

This is later going to replace the existing virNodeDevCapMdevType, since:
1) it's going to couple related stuff in a single module
2) util is supposed to contain helpers that are widely accessible across
the whole repository.
Signed-off-by: NErik Skultety <eskultet@redhat.com>
上级 0674ddd3
......@@ -2181,6 +2181,7 @@ virMediatedDeviceModelTypeFromString;
virMediatedDeviceModelTypeToString;
virMediatedDeviceNew;
virMediatedDeviceSetUsedBy;
virMediatedDeviceTypeFree;
......
......@@ -483,3 +483,16 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
}
goto cleanup;
}
void
virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type)
{
if (!type)
return;
VIR_FREE(type->id);
VIR_FREE(type->name);
VIR_FREE(type->device_api);
VIR_FREE(type);
}
......@@ -37,6 +37,15 @@ typedef virMediatedDevice *virMediatedDevicePtr;
typedef struct _virMediatedDeviceList virMediatedDeviceList;
typedef virMediatedDeviceList *virMediatedDeviceListPtr;
typedef struct _virMediatedDeviceType virMediatedDeviceType;
typedef virMediatedDeviceType *virMediatedDeviceTypePtr;
struct _virMediatedDeviceType {
char *id;
char *name;
char *device_api;
unsigned int available_instances;
};
typedef int (*virMediatedDeviceCallback)(virMediatedDevicePtr dev,
const char *path, void *opaque);
......@@ -117,4 +126,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
virMediatedDeviceListPtr src,
const char *drvname,
const char *domname);
void
virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type);
#endif /* __VIR_MDEV_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册