diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 5117640ffb5c9bcdd3df67c0856d40abcaa442b8..fb7635499ff64d9889fbd2aa2683395b7ce3db8d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2181,6 +2181,7 @@ virMediatedDeviceModelTypeFromString; virMediatedDeviceModelTypeToString; virMediatedDeviceNew; virMediatedDeviceSetUsedBy; +virMediatedDeviceTypeFree; diff --git a/src/util/virmdev.c b/src/util/virmdev.c index a5f52d10f3cdf931ced6f37c0f476f8a211dd264..db679b8a6db93ae0102dc2bb4a2fecafe88509e0 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -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); +} diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 84cbb1f2a974df453637af5fadaf2de02322ca3c..320610ab97326a5ed5c293a3b196ca513a209792 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -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__ */