mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
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: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
0674ddd317
commit
c3faa92a1b
@ -2181,6 +2181,7 @@ virMediatedDeviceModelTypeFromString;
|
|||||||
virMediatedDeviceModelTypeToString;
|
virMediatedDeviceModelTypeToString;
|
||||||
virMediatedDeviceNew;
|
virMediatedDeviceNew;
|
||||||
virMediatedDeviceSetUsedBy;
|
virMediatedDeviceSetUsedBy;
|
||||||
|
virMediatedDeviceTypeFree;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -483,3 +483,16 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
|
|||||||
}
|
}
|
||||||
goto cleanup;
|
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 struct _virMediatedDeviceList virMediatedDeviceList;
|
||||||
typedef virMediatedDeviceList *virMediatedDeviceListPtr;
|
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,
|
typedef int (*virMediatedDeviceCallback)(virMediatedDevicePtr dev,
|
||||||
const char *path, void *opaque);
|
const char *path, void *opaque);
|
||||||
|
|
||||||
@ -117,4 +126,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
|
|||||||
virMediatedDeviceListPtr src,
|
virMediatedDeviceListPtr src,
|
||||||
const char *drvname,
|
const char *drvname,
|
||||||
const char *domname);
|
const char *domname);
|
||||||
|
|
||||||
|
void
|
||||||
|
virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type);
|
||||||
#endif /* __VIR_MDEV_H__ */
|
#endif /* __VIR_MDEV_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user