Re: [PATCH] hash: make virHashFree more free-like

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/18/2011 04:31 PM, Eric Blake wrote:
Two-argument free functions are uncommon; match the style elsewhere
by caching the callback at creation.

* src/util/hash.h (virHashCreate, virHashFree): Move deallocator
argument to creation.
* cfg.mk (useless_free_options): Add virHashFree.
* src/util/hash.c (_virHashTable): Track deallocator.
(virHashCreate, virHashFree): Update to new signature.
* src/conf/domain_conf.c (virDomainObjListDeinit)
(virDomainObjListInit, virDomainDiskDefForeachPath)
(virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
Update callers.
* src/conf/nwfilter_params.c (virNWFilterHashTableFree)
(virNWFilterHashTableCreate): Likewise.
* src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
Likewise.
* src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
Likewise.
* src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
* src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
(virNWFilterLearnShutdown): Likewise.
* src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
(qemuDomainPCIAddressSetFree): Likewise.
* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
---

Requires that this be applied first:
https://www.redhat.com/archives/libvir-list/2011-February/msg00784.html

  cfg.mk                              |    1 +
  src/conf/domain_conf.c              |   49 ++++++++++++++++++----------------
  src/conf/nwfilter_conf.c            |    6 ++--
  src/conf/nwfilter_params.c          |    5 ++-
  src/cpu/cpu_generic.c               |   10 +++---
  src/nwfilter/nwfilter_learnipaddr.c |    9 +++---
  src/qemu/qemu_command.c             |   16 ++++++-----
  src/qemu/qemu_process.c             |    4 +-
  src/util/hash.c                     |   14 +++++----
  src/util/hash.h                     |    9 +++---
  src/xen/xm_internal.c               |   12 ++++----
  11 files changed, 73 insertions(+), 62 deletions(-)

ACK. Pretty mechanical conversion, and a great idea!


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]