The function destroys only the contents not the object itself thus it should be called Clear. --- Notes: Version 2: - already ACKed, no change (couldn't be pushed due to conflicts) src/conf/domain_conf.c | 6 +++--- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_command.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3efdb9d..4d3812a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1216,13 +1216,13 @@ void virDomainDiskDefFree(virDomainDiskDefPtr def) } for (i = 0; i < def->nhosts; i++) - virDomainDiskHostDefFree(&def->hosts[i]); + virDomainDiskHostDefClear(&def->hosts[i]); VIR_FREE(def->hosts); VIR_FREE(def); } -void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def) +void virDomainDiskHostDefClear(virDomainDiskHostDefPtr def) { if (!def) return; @@ -4857,7 +4857,7 @@ error: VIR_FREE(protocol); VIR_FREE(transport); while (nhosts > 0) { - virDomainDiskHostDefFree(&hosts[nhosts - 1]); + virDomainDiskHostDefClear(&hosts[nhosts - 1]); nhosts--; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4520ae4..458be97 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2208,7 +2208,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def); void virDomainInputDefFree(virDomainInputDefPtr def); void virDomainDiskDefFree(virDomainDiskDefPtr def); void virDomainLeaseDefFree(virDomainLeaseDefPtr def); -void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def); +void virDomainDiskHostDefClear(virDomainDiskHostDefPtr def); int virDomainDeviceFindControllerModel(virDomainDefPtr def, virDomainDeviceInfoPtr info, int controllerType); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 76016ca..a705c56 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -197,7 +197,7 @@ virDomainDiskErrorPolicyTypeToString; virDomainDiskFindByBusAndDst; virDomainDiskGeometryTransTypeFromString; virDomainDiskGeometryTransTypeToString; -virDomainDiskHostDefFree; +virDomainDiskHostDefClear; virDomainDiskIndexByName; virDomainDiskInsert; virDomainDiskInsertPreAlloced; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e48c9c2..4922845 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3509,7 +3509,7 @@ cleanup: return ret; error: - virDomainDiskHostDefFree(def->hosts); + virDomainDiskHostDefClear(def->hosts); VIR_FREE(def->hosts); goto cleanup; } @@ -3611,7 +3611,7 @@ qemuParseNBDString(virDomainDiskDefPtr disk) return 0; error: - virDomainDiskHostDefFree(h); + virDomainDiskHostDefClear(h); VIR_FREE(h); return -1; } -- 1.8.4.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list