[PATCH 0/8] virsh: Use g_autoptr() for public types

Michal Privoznik mprivozn at redhat.com
Mon Sep 27 05:07:42 UTC 2021


In this patchset I'm switching from virXXXFree to g_autoptr(). There are
still some left, but very rare occurrence:

  libvirt.git $ git grep -o "vir[A-Z].*Free" -- tools/ | \
                cut -d':' -f 2 | sort | uniq -c | sort -n

And of course, after these some functions could use subsequent cleanup,
e.g. because cleanup label collapsed to just return statement. But I
leave those for future work.

Michal Prívozník (8):
  virsh-util.h: Fix ordering of virshXXXFree functions
  virsh: Add wrapper for virInterfaceFree
  virsh: Add wrapper for virStoragePoolFree
  virsh: Add wrapper for virStorageVolFree
  virsh: Add wrapper for virNetworkFree
  virsh: Add wrapper for virNodeDeviceFree
  virsh: Add wrapper for virNWFilterFree
  virsh: Add wrapper for virStreamFree

 build-aux/syntax-check.mk         |   4 +-
 tools/virsh-completer-interface.c |   3 +-
 tools/virsh-completer-network.c   |   8 +--
 tools/virsh-completer-nodedev.c   |   3 +-
 tools/virsh-completer-nwfilter.c  |   3 +-
 tools/virsh-completer-pool.c      |   3 +-
 tools/virsh-completer-volume.c    |   8 +--
 tools/virsh-console.c             |   8 +--
 tools/virsh-domain.c              |  10 +--
 tools/virsh-interface.c           |  55 +++++----------
 tools/virsh-network.c             |  75 ++++++--------------
 tools/virsh-nodedev.c             |  49 ++++----------
 tools/virsh-nwfilter.c            |  22 ++----
 tools/virsh-pool.c                |  67 ++++++------------
 tools/virsh-util.c                |  78 +++++++++++++++++++++
 tools/virsh-util.h                |  46 +++++++++++--
 tools/virsh-volume.c              | 109 ++++++++----------------------
 17 files changed, 254 insertions(+), 297 deletions(-)

-- 
2.32.0




More information about the libvir-list mailing list