mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
Introduce virStoragePoolSourceDeviceClear
Open-coding one VIR_FREE in the test suite just doesn't seem right.
This commit is contained in:
parent
cc8bc54bfc
commit
20f0cd4ca3
@ -356,6 +356,13 @@ virStoragePoolSourceAdapterClear(virStoragePoolSourceAdapter adapter)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev)
|
||||
{
|
||||
VIR_FREE(dev->freeExtents);
|
||||
VIR_FREE(dev->path);
|
||||
}
|
||||
|
||||
void
|
||||
virStoragePoolSourceClear(virStoragePoolSourcePtr source)
|
||||
{
|
||||
@ -369,10 +376,8 @@ virStoragePoolSourceClear(virStoragePoolSourcePtr source)
|
||||
}
|
||||
VIR_FREE(source->hosts);
|
||||
|
||||
for (i = 0; i < source->ndevice; i++) {
|
||||
VIR_FREE(source->devices[i].freeExtents);
|
||||
VIR_FREE(source->devices[i].path);
|
||||
}
|
||||
for (i = 0; i < source->ndevice; i++)
|
||||
virStoragePoolSourceDeviceClear(&source->devices[i]);
|
||||
VIR_FREE(source->devices);
|
||||
VIR_FREE(source->dir);
|
||||
VIR_FREE(source->name);
|
||||
|
@ -432,6 +432,7 @@ int virStoragePoolObjDeleteDef(virStoragePoolObjPtr pool);
|
||||
|
||||
void virStorageVolDefFree(virStorageVolDefPtr def);
|
||||
void virStoragePoolSourceClear(virStoragePoolSourcePtr source);
|
||||
void virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev);
|
||||
void virStoragePoolSourceFree(virStoragePoolSourcePtr source);
|
||||
void virStoragePoolDefFree(virStoragePoolDefPtr def);
|
||||
void virStoragePoolObjFree(virStoragePoolObjPtr pool);
|
||||
|
@ -710,6 +710,7 @@ virStoragePoolObjUnlock;
|
||||
virStoragePoolSourceAdapterTypeTypeFromString;
|
||||
virStoragePoolSourceAdapterTypeTypeToString;
|
||||
virStoragePoolSourceClear;
|
||||
virStoragePoolSourceDeviceClear;
|
||||
virStoragePoolSourceFindDuplicate;
|
||||
virStoragePoolSourceFindDuplicateDevices;
|
||||
virStoragePoolSourceFree;
|
||||
|
Loading…
Reference in New Issue
Block a user