From 68fb03c7c082c9eb1f3fb5cfeab31d8e55811481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 15 Oct 2019 16:04:32 +0200 Subject: [PATCH] Remove virautoclean.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we no longer use any of the macros from this file, remove it. This also removes a typo. Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- src/conf/domain_capabilities.h | 1 - src/conf/storage_conf.h | 1 - src/qemu/qemu_firmware.h | 1 - src/qemu/qemu_migration_params.h | 1 - src/qemu/qemu_vhost_user.h | 1 - src/util/Makefile.inc.am | 1 - src/util/virauthconfig.h | 1 - src/util/virautoclean.h | 89 -------------------------------- src/util/virbitmap.h | 1 - src/util/virbuffer.h | 1 - src/util/vircommand.h | 1 - src/util/virconf.h | 1 - src/util/virerror.h | 1 - src/util/virfile.h | 1 - src/util/virfirewall.h | 1 - src/util/virhash.h | 2 - src/util/virjson.h | 1 - src/util/virmacaddr.h | 1 - src/util/virmdev.h | 1 - src/util/virnetdev.h | 1 - src/util/virnetdevip.h | 1 - src/util/virnetdevvlan.h | 1 - src/util/virnetlink.h | 1 - src/util/virpci.h | 1 - src/util/virperf.h | 1 - src/util/virscsi.h | 1 - src/util/virscsivhost.h | 1 - src/util/virsocketaddr.h | 1 - src/util/virstoragefile.h | 1 - src/util/virsystemd.h | 1 - src/util/virtypedparam.h | 1 - src/util/viruri.h | 1 - src/util/virusb.h | 1 - src/util/virxml.h | 1 - tests/qemumonitortestutils.h | 1 - 35 files changed, 124 deletions(-) delete mode 100644 src/util/virautoclean.h diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index b5c322fd90..a31458c653 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -22,7 +22,6 @@ #include "internal.h" #include "domain_conf.h" -#include "virautoclean.h" #include "virenum.h" typedef const char * (*virDomainCapsValToStr)(int value); diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index b172e82ccb..d2600efff0 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -29,7 +29,6 @@ #include "device_conf.h" #include "object_event.h" #include "storage_adapter_conf.h" -#include "virautoclean.h" #include "virenum.h" #include "virxml.h" diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h index 10b8eb822b..4be65bc664 100644 --- a/src/qemu/qemu_firmware.h +++ b/src/qemu/qemu_firmware.h @@ -22,7 +22,6 @@ #include "domain_conf.h" #include "qemu_conf.h" -#include "virautoclean.h" #include "virarch.h" #include "virfirmware.h" diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h index e8380e6fb1..9aea24725f 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -27,7 +27,6 @@ #include "virxml.h" #include "qemu_monitor.h" #include "qemu_conf.h" -#include "virautoclean.h" #include "virenum.h" typedef enum { diff --git a/src/qemu/qemu_vhost_user.h b/src/qemu/qemu_vhost_user.h index 6bb5f5807c..369ba00caa 100644 --- a/src/qemu/qemu_vhost_user.h +++ b/src/qemu/qemu_vhost_user.h @@ -22,7 +22,6 @@ #include "domain_conf.h" #include "qemu_conf.h" -#include "virautoclean.h" #include "virarch.h" typedef struct _qemuVhostUser qemuVhostUser; diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index 9747816fac..705b93c93c 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -17,7 +17,6 @@ UTIL_SOURCES = \ util/virauth.h \ util/virauthconfig.c \ util/virauthconfig.h \ - util/virautoclean.h \ util/virbitmap.c \ util/virbitmap.h \ util/virbuffer.c \ diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h index 44bef7e2be..de28b1ff28 100644 --- a/src/util/virauthconfig.h +++ b/src/util/virauthconfig.h @@ -21,7 +21,6 @@ #pragma once #include "internal.h" -#include "virautoclean.h" typedef struct _virAuthConfig virAuthConfig; typedef virAuthConfig *virAuthConfigPtr; diff --git a/src/util/virautoclean.h b/src/util/virautoclean.h deleted file mode 100644 index 71312a2782..0000000000 --- a/src/util/virautoclean.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * virautoclean.h: automatic scope-based memory clearing helper macros for - * use in header files - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - * - */ - -#pragma once - -/** - * DEPRECATION WARNING - * - * The macros in this file should not be used in newly written code. - * Use the equivalent GLib macros instead. - * - * For existing code, use of the libvirt and GLib macros must NEVER - * be mixed within a single method. - * - * The use of the libvirt VIR_FREE macros should also not be mixed - * with GLib auto-free macros and vice-verca. - * - * Existing code should be converted to the new GLib macros and - * g_free APIs as needed. - */ - -/** - * VIR_DEFINE_AUTOPTR_FUNC: - * @type: type of the variable to be freed automatically - * @func: cleanup function to be automatically called - * - * This macro defines a function for automatic freeing of - * resources allocated to a variable of type @type. This newly - * defined function works as a necessary wrapper around @func. - */ -#define VIR_DEFINE_AUTOPTR_FUNC(t, f) \ - G_DEFINE_AUTOPTR_CLEANUP_FUNC(t, f) - -/** - * VIR_DEFINE_AUTOCLEAN_FUNC: - * @type: type of the variable to be cleared automatically - * @func: cleanup function to be automatically called - * - * This macro defines a function for automatic clearing of - * resources in a stack'd variable of type @type. Note that @func must - * take pointer to @type. - */ -#define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \ - G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(type, func) - -/** - * VIR_AUTOPTR: - * @type: type of the variable to be freed automatically - * - * Macro to automatically free the memory allocated to - * the variable declared with it by calling the function - * defined by VIR_DEFINE_AUTOPTR_FUNC when the variable - * goes out of scope. - * - * Note that this macro must NOT be used with vectors! The freeing function - * will not free any elements beyond the first. - */ -#define VIR_AUTOPTR(type) g_autoptr(type) - -/** - * VIR_AUTOCLEAN: - * @type: type of the variable to be cleared automatically - * - * Macro to automatically call clearing function registered for variable of @type - * when the variable goes out of scope. - * The cleanup function is registered by VIR_DEFINE_AUTOCLEAN_FUNC macro for - * the given type. - * - * Note that this macro must NOT be used with vectors! The cleaning function - * will not clean any elements beyond the first. - */ -#define VIR_AUTOCLEAN(type) g_auto(type) diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index e0c5541c13..7f1a109c01 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -22,7 +22,6 @@ #pragma once #include "internal.h" -#include "virautoclean.h" #include diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index 0c074121bc..ff24ab1019 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -23,7 +23,6 @@ #include #include "internal.h" -#include "virautoclean.h" /** diff --git a/src/util/vircommand.h b/src/util/vircommand.h index 2f39dec1b3..9086f9a90c 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -23,7 +23,6 @@ #include "internal.h" #include "virbuffer.h" -#include "virautoclean.h" typedef struct _virCommand virCommand; typedef virCommand *virCommandPtr; diff --git a/src/util/virconf.h b/src/util/virconf.h index 304b325985..0b2de34d36 100644 --- a/src/util/virconf.h +++ b/src/util/virconf.h @@ -22,7 +22,6 @@ #include "virutil.h" #include "virenum.h" -#include "virautoclean.h" /** * virConfType: diff --git a/src/util/virerror.h b/src/util/virerror.h index 7e5ed29ae2..2e27655b72 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -22,7 +22,6 @@ #pragma once #include "internal.h" -#include "virautoclean.h" #define VIR_ERROR_MAX_LENGTH 1024 diff --git a/src/util/virfile.h b/src/util/virfile.h index b8256a96b3..a570529330 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -29,7 +29,6 @@ #include "internal.h" #include "virbitmap.h" #include "virstoragefile.h" -#include "virautoclean.h" typedef enum { VIR_FILE_CLOSE_PRESERVE_ERRNO = 1 << 0, diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h index bcc1437b9a..6148f46827 100644 --- a/src/util/virfirewall.h +++ b/src/util/virfirewall.h @@ -21,7 +21,6 @@ #pragma once #include "internal.h" -#include "virautoclean.h" typedef struct _virFirewall virFirewall; typedef virFirewall *virFirewallPtr; diff --git a/src/util/virhash.h b/src/util/virhash.h index 5bb59376af..b5e7c79260 100644 --- a/src/util/virhash.h +++ b/src/util/virhash.h @@ -9,8 +9,6 @@ #pragma once -#include "virautoclean.h" - /* * The hash table. */ diff --git a/src/util/virjson.h b/src/util/virjson.h index 1ce7b75e3b..fa8571c73b 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -25,7 +25,6 @@ #include "internal.h" #include "virbitmap.h" #include "virbuffer.h" -#include "virautoclean.h" #include diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h index 2fda2b0239..0296cfa965 100644 --- a/src/util/virmacaddr.h +++ b/src/util/virmacaddr.h @@ -21,7 +21,6 @@ #pragma once #include "internal.h" -#include "virautoclean.h" #define VIR_MAC_BUFLEN 6 #define VIR_MAC_HEXLEN (VIR_MAC_BUFLEN * 2) diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 2f73b1a530..e0905a3f6e 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -21,7 +21,6 @@ #include "internal.h" #include "virobject.h" #include "virutil.h" -#include "virautoclean.h" #include "virenum.h" typedef enum { diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index ea3779bb98..b5a5214bcb 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -25,7 +25,6 @@ #include "virmacaddr.h" #include "virpci.h" #include "virnetdevvlan.h" -#include "virautoclean.h" #include "virenum.h" #ifdef HAVE_STRUCT_IFREQ diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h index 59d2d4a044..1fa6dd8836 100644 --- a/src/util/virnetdevip.h +++ b/src/util/virnetdevip.h @@ -19,7 +19,6 @@ #pragma once #include "virsocketaddr.h" -#include "virautoclean.h" typedef struct _virNetDevIPAddr virNetDevIPAddr; typedef virNetDevIPAddr *virNetDevIPAddrPtr; diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index 0e4fd03dcb..9dbf07a6e2 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -20,7 +20,6 @@ #include -#include "virautoclean.h" #include "virenum.h" typedef enum { diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 5cb6060b3b..030547e573 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -21,7 +21,6 @@ #include "internal.h" #include "virmacaddr.h" -#include "virautoclean.h" #if defined(__linux__) && defined(HAVE_LIBNL) diff --git a/src/util/virpci.h b/src/util/virpci.h index 4ffe5db2d6..cfb4581edf 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -24,7 +24,6 @@ #include "virmdev.h" #include "virobject.h" #include "virutil.h" -#include "virautoclean.h" #include "virenum.h" typedef struct _virPCIDevice virPCIDevice; diff --git a/src/util/virperf.h b/src/util/virperf.h index df990109b1..3102b42af9 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -19,7 +19,6 @@ #pragma once #include "virutil.h" -#include "virautoclean.h" #include "virenum.h" /* Some Intel processor families introduced some RDT (Resource Director diff --git a/src/util/virscsi.h b/src/util/virscsi.h index 3a92366efc..51627e0c05 100644 --- a/src/util/virscsi.h +++ b/src/util/virscsi.h @@ -22,7 +22,6 @@ #include "internal.h" #include "virobject.h" -#include "virautoclean.h" typedef struct _virSCSIDevice virSCSIDevice; typedef virSCSIDevice *virSCSIDevicePtr; diff --git a/src/util/virscsivhost.h b/src/util/virscsivhost.h index d3185b14bc..a5296890cd 100644 --- a/src/util/virscsivhost.h +++ b/src/util/virscsivhost.h @@ -23,7 +23,6 @@ #include "internal.h" #include "virobject.h" #include "virutil.h" -#include "virautoclean.h" typedef struct _virSCSIVHostDevice virSCSIVHostDevice; typedef virSCSIVHostDevice *virSCSIVHostDevicePtr; diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 6cdf7b7c4f..1180864f06 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -25,7 +25,6 @@ #endif #include "internal.h" -#include "virautoclean.h" /* On architectures which lack these limits, define them (ie. Cygwin). * Note that the libvirt code should be robust enough to handle the diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 545e60ba00..c357803e50 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -29,7 +29,6 @@ #include "virstorageencryption.h" #include "virutil.h" #include "virsecret.h" -#include "virautoclean.h" #include "virenum.h" /* Minimum header size required to probe all known formats with diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h index fcdf6d17fe..dfea75948b 100644 --- a/src/util/virsystemd.h +++ b/src/util/virsystemd.h @@ -22,7 +22,6 @@ #pragma once #include "internal.h" -#include "virautoclean.h" typedef struct _virSystemdActivation virSystemdActivation; typedef virSystemdActivation *virSystemdActivationPtr; diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index 42a4da466e..ea48ee5009 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -24,7 +24,6 @@ #include "internal.h" #include "virutil.h" #include "virenum.h" -#include "virautoclean.h" /** * VIR_TYPED_PARAM_MULTIPLE: diff --git a/src/util/viruri.h b/src/util/viruri.h index f91debefe9..b7f845f41f 100644 --- a/src/util/viruri.h +++ b/src/util/viruri.h @@ -24,7 +24,6 @@ #include "internal.h" #include "virconf.h" -#include "virautoclean.h" typedef struct _virURI virURI; typedef virURI *virURIPtr; diff --git a/src/util/virusb.h b/src/util/virusb.h index 7ff1d55c9e..42a3303952 100644 --- a/src/util/virusb.h +++ b/src/util/virusb.h @@ -22,7 +22,6 @@ #include "internal.h" #include "virobject.h" -#include "virautoclean.h" #define USB_DEVFS "/dev/bus/usb/" diff --git a/src/util/virxml.h b/src/util/virxml.h index 283c592b2c..dfdc1f73c3 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -28,7 +28,6 @@ #include #include "virbuffer.h" -#include "virautoclean.h" xmlXPathContextPtr virXMLXPathContextNew(xmlDocPtr xml) G_GNUC_WARN_UNUSED_RESULT; diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index f6d7f3623c..8e213ec921 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -23,7 +23,6 @@ #include "qemu/qemu_conf.h" #include "qemu/qemu_monitor.h" #include "qemu/qemu_agent.h" -#include "virautoclean.h" typedef struct _qemuMonitorTest qemuMonitorTest; typedef qemuMonitorTest *qemuMonitorTestPtr;