[libvirt] [PATCH 00/42] Cleanups after adopting g_get_*_dir()

Fabiano Fidêncio fidencio at redhat.com
Thu Dec 19 10:04:05 UTC 2019


After adopting g_get_*_dir(), internally, when implementing
virGetUser*Dir(), the libvirt functions changed their behaviour as NULL
is never ever returned by the GLib functions.

Knowing that, let's cleanup the callers' code of those functions,
removing the unnecessary checks.

While doing the cleanup mentioned above, I've noticed that some other
cleanups could be done, when touching the very same function, as using
g_autofree. It's done as part of this series as well.

phyp driver was not touched as there's some plan to just drop its code
entirely: https://www.redhat.com/archives/libvir-list/2019-December/msg01162.html

Fabiano Fidêncio (42):
  tools: Use g_autofree on cmdCd()
  vbox: Don't leak virGetUserDirectory()'s output
  rpc: Use g_autofree on virNetClientNewLibSSH2()
  rpc: Use g_autofree on virNetClientNewLibssh()
  rpc: Don't check the output of virGetUserDirectory()
  qemu: Don't check the output of virGetUserDirectory()
  util: Don't check the output of virGetUserConfigDirectory()
  storage: Don't check the output of virGetUserConfigDirectory()
  secret: Don't check the output of virGetUserConfigDirectory()
  tools: Don't check the output of virGetUserCacheDirectory()
  vbox: Use g_autofree on vboxDomainScreenshot()
  vbox: Don't check the output of virGetUserCacheDirectory()
  util: Use g_autofree on virLogSetDefaultOutputToFile()
  util: Don't check the output of virGetUserCacheDirectory()
  qemu: Don't check the output of virGetUserCacheDirectory()
  rpc: Don't check the output of virGetUserConfigDirectory()
  remote: Don't check the output of virGetUserConfigDirectory()
  qemu: Don't check the output of virGetUserConfigDirectory()
  network: Don't check the output of virGetUserConfigDirectory()
  logging: Use g_autofree on virLogDaemonConfigFilePath()
  logging: Don't check the output of virGetUserConfigDirectory()
  locking: Use g_autofree on virLockDaemonConfigFilePath()
  locking: Don't check the output of virGetUserConfigDirectory()
  util: Don't check the output of virGetUserRuntimeDirectory()
  storage: Don't check the output of virGetUserRuntimeDirectory()
  secret: Don't check the output of virGetUserRuntimeDirectory()
  rpc: Don't check the output of virGetUserRuntimeDirectory()
  remote: Don't check the output of virGetUserRuntimeDirectory()
  qemu: Don't check the output of virGetUserRuntimeDirectory()
  node_device: Don't check the output of virGetUserRuntimeDirectory()
  network: Don't check the output of virGetUserRuntimeDirectory()
  logging: Use g_autofree on virLogManagerDaemonPath()
  logging: Use g_autofree on virLogDaemonUnixSocketPaths()
  logging: Use g_autofree on virLogDaemonExecRestartStatePath()
  logging: Don't check the output of virGetUserRuntimeDirectory()
  locking: Use g_autofree on virLockManagerLockDaemonPath()
  locking: Use g_autofree on virLockDaemonUnixSocketPaths()
  locking: Use g_autofree on virLockDaemonExecRestartStatePath()
  locking: Don't check the output of virGetUserRuntimeDirectory()
  interface: Don't check the output of virGetUserRuntimeDirectory()
  admin: Use g_autofree on getSocketPath()
  admin: Don't check the output of virGetUserRuntimeDirectory()

 src/admin/libvirt-admin.c               |  6 +--
 src/interface/interface_backend_netcf.c |  3 +-
 src/interface/interface_backend_udev.c  |  3 +-
 src/locking/lock_daemon.c               | 31 +++----------
 src/locking/lock_daemon_config.c        |  9 +---
 src/locking/lock_driver_lockd.c         |  7 +--
 src/logging/log_daemon.c                | 31 +++----------
 src/logging/log_daemon_config.c         |  9 +---
 src/logging/log_manager.c               |  7 +--
 src/network/bridge_driver.c             |  2 -
 src/node_device/node_device_hal.c       |  3 +-
 src/node_device/node_device_udev.c      |  3 +-
 src/qemu/qemu_conf.c                    |  7 +--
 src/qemu/qemu_interop_config.c          |  3 --
 src/remote/remote_daemon.c              |  8 +---
 src/remote/remote_daemon_config.c       |  6 +--
 src/remote/remote_driver.c              |  3 +-
 src/rpc/virnetclient.c                  | 59 +++++++++----------------
 src/rpc/virnetsocket.c                  |  3 +-
 src/rpc/virnettlscontext.c              | 12 -----
 src/secret/secret_driver.c              |  6 +--
 src/storage/storage_driver.c            |  2 -
 src/util/virauth.c                      |  3 +-
 src/util/virconf.c                      |  2 -
 src/util/virhostdev.c                   |  3 +-
 src/util/virlog.c                       | 13 ++----
 src/util/virpidfile.c                   |  3 +-
 src/vbox/vbox_common.c                  | 12 ++---
 src/vbox/vbox_storage.c                 |  7 ++-
 tools/vsh.c                             | 13 ++----
 30 files changed, 73 insertions(+), 206 deletions(-)

-- 
2.24.1




More information about the libvir-list mailing list