]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lib: Prefer WITH_* prefix for #if conditionals
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Sep 2020 11:27:44 +0000 (13:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Sep 2020 08:28:10 +0000 (10:28 +0200)
Currently, we are mixing: #if HAVE_BLAH with #if WITH_BLAH.
Things got way better with Pavel's work on meson, but apparently,
mixing these two lead to confusing and easy to miss bugs (see
31fb929eca for instance). While we were forced to use HAVE_
prefix with autotools, we are free to chose our own prefix with
meson and since WITH_ prefix appears to be more popular let's use
it everywhere.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
71 files changed:
build-aux/syntax-check.mk
docs/coding-style.rst
meson.build
src/admin/libvirt-admin.c
src/conf/nwfilter_conf.c
src/cpu/cpu_arm.c
src/internal.h
src/libvirt.c
src/libxl/libxl_capabilities.c
src/libxl/libxl_conf.c
src/libxl/xen_xl.c
src/locking/lock_driver_sanlock.c
src/locking/lock_manager.c
src/network/bridge_driver.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_learnipaddr.c
src/qemu/qemu_namespace.c
src/qemu/qemu_process.c
src/rpc/virnetsocket.c
src/storage/storage_backend_rbd.c
src/storage/storage_driver.c
src/storage/storage_util.c
src/util/iohelper.c
src/util/virbpf.c
src/util/virbpf.h
src/util/vircgroupv2devices.c
src/util/virdbus.c
src/util/virdbuspriv.h
src/util/virfile.c
src/util/virgettext.c
src/util/virhostcpu.c
src/util/virhostmem.c
src/util/virhostuptime.c
src/util/virlog.c
src/util/virmodule.c
src/util/virnetdev.c
src/util/virnetdev.h
src/util/virnetdevbridge.c
src/util/virnetdevip.c
src/util/virnetdevmacvlan.c
src/util/virnetdevtap.c
src/util/virnetlink.c
src/util/virnetlink.h
src/util/virnuma.c
src/util/virperf.c
src/util/virprocess.c
src/util/virstring.c
src/util/virthread.c
src/util/virutil.c
src/util/virutil.h
src/util/virvsock.c
tests/eventtest.c
tests/libxlxml2domconfigtest.c
tests/meson.build
tests/securityselinuxhelper.c
tests/virfilemock.c
tests/virfiletest.c
tests/virmock.h
tests/virmockstathelpers.c
tests/virnetsockettest.c
tests/virnettlscontexttest.c
tests/virnettlshelpers.c
tests/virnettlshelpers.h
tests/virnettlssessiontest.c
tests/virportallocatormock.c
tests/virportallocatortest.c
tests/virstoragetest.c
tests/vshtabletest.c
tools/nss/libvirt_nss.c
tools/nss/libvirt_nss.h
tools/virt-host-validate.c

index 16c70750e85d8f7f9ad3f660393540a6b0e2c244..af3af54de4d4bd3dc564bed84cf8563431877001 100644 (file)
@@ -1397,8 +1397,8 @@ sc_require_config_h_first:
        else :;                                                         \
        fi
 
-sc_prohibit_HAVE_MBRTOWC:
-       @prohibit='\bHAVE_MBRTOWC\b'                                    \
+sc_prohibit_WITH_MBRTOWC:
+       @prohibit='\bWITH_MBRTOWC\b'                                    \
        halt="do not use $$prohibit; it is always defined"              \
          $(_sc_search_regexp)
 
@@ -1617,8 +1617,8 @@ sc_unmarked_diagnostics:
 
 
 sc_prohibit_defined_have_decl_tests:
-       @prohibit='(#[   ]*ifn?def|\<defined)\>[         (]+HAVE_DECL_' \
-       halt='HAVE_DECL macros are always defined'                      \
+       @prohibit='(#[   ]*ifn?def|\<defined)\>[         (]+WITH_DECL_' \
+       halt='WITH_DECL macros are always defined'                      \
          $(_sc_search_regexp)
 
 # ==================================================================
@@ -1801,7 +1801,7 @@ sc_po_check:
          rm -f $@-1 $@-2;                                              \
        fi
 
-# #if HAVE_... will evaluate to false for any non numeric string.
+# #if WITH_... will evaluate to false for any non numeric string.
 # That would be flagged by using -Wundef, however gnulib currently
 # tests many undefined macros, and so we can't enable that option.
 # So at least preclude common boolean strings as macro values.
index 00d95b960f5e0752823cb3d9e640d0eb23315de0..942caf4e0979d99dee99136b45cc226d109e6e12 100644 (file)
@@ -474,7 +474,7 @@ indentation to track nesting:
 
 ::
 
-  #if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_FALLOCATE)
+  #if defined(WITH_POSIX_FALLOCATE) && !defined(WITH_FALLOCATE)
   # define fallocate(a, ignored, b, c) posix_fallocate(a, b, c)
   #endif
 
index c1967d63580e0a4c4e98646e2fea7f1a6837b90c..c794e34bcb1548df5cece96dd0eceedfbfdcd290 100644 (file)
@@ -583,7 +583,7 @@ supported_cc_flags = cc.get_supported_arguments(cc_flags)
 add_project_arguments(supported_cc_flags, language: 'c')
 
 if cc.has_argument('-Wsuggest-attribute=format')
-  conf.set('HAVE_SUGGEST_ATTRIBUTE_FORMAT', 1)
+  conf.set('WITH_SUGGEST_ATTRIBUTE_FORMAT', 1)
 endif
 
 # used in tests
@@ -676,7 +676,7 @@ functions = [
 
 foreach function : functions
   if cc.has_function(function)
-    conf.set('HAVE_@0@'.format(function.to_upper()), 1)
+    conf.set('WITH_@0@'.format(function.to_upper()), 1)
   endif
 endforeach
 
@@ -715,7 +715,7 @@ endif
 
 foreach name : headers
   if cc.has_header(name)
-    conf.set('HAVE_@0@'.format(name.underscorify().to_upper()), 1)
+    conf.set('WITH_@0@'.format(name.underscorify().to_upper()), 1)
   endif
 endforeach
 
@@ -799,7 +799,7 @@ endif
 
 foreach symbol : symbols
   if cc.has_header_symbol(symbol[0], symbol[1], args: '-D_GNU_SOURCE', prefix: symbol.get(2, ''))
-    conf.set('HAVE_DECL_@0@'.format(symbol[1].to_upper()), 1)
+    conf.set('WITH_DECL_@0@'.format(symbol[1].to_upper()), 1)
   endif
 endforeach
 
@@ -810,19 +810,19 @@ brd_required_headers = '''#include <stdint.h>
 if (cc.has_header_symbol('net/if_bridgevar.h', 'BRDGSFD', prefix: brd_required_headers) and
     cc.has_header_symbol('net/if_bridgevar.h', 'BRDGADD', prefix: brd_required_headers) and
     cc.has_header_symbol('net/if_bridgevar.h', 'BRDGDEL', prefix: brd_required_headers))
-  conf.set('HAVE_BSD_BRIDGE_MGMT', 1)
+  conf.set('WITH_BSD_BRIDGE_MGMT', 1)
 endif
 
 # Check for BSD CPU affinity availability
 if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity')
-  conf.set('HAVE_BSD_CPU_AFFINITY', 1)
+  conf.set('WITH_BSD_CPU_AFFINITY', 1)
 endif
 
 # whether Mach clock routines are available
 if (cc.has_header_symbol('mach/clock.h', 'clock_serv_t') and
     cc.has_header_symbol('mach/clock.h', 'host_get_clock_service') and
     cc.has_header_symbol('mach/clock.h', 'clock_get_time'))
-  conf.set('HAVE_MACH_CLOCK_ROUTINES', 1)
+  conf.set('WITH_MACH_CLOCK_ROUTINES', 1)
 endif
 
 
@@ -836,7 +836,7 @@ types = [
 foreach type : types
   if cc.has_type(type[0], prefix: type[1])
     name = type[0].underscorify().to_upper()
-    conf.set('HAVE_@0@'.format(name), 1)
+    conf.set('WITH_@0@'.format(name), 1)
   endif
 endforeach
 
@@ -867,7 +867,7 @@ foreach member : members
   if cc.has_member(member[0], member[1], prefix: member[2])
     type = member[0].underscorify().to_upper()
     member = member[1].underscorify().to_upper()
-    conf.set('HAVE_@0@_@1@'.format(type, member), 1)
+    conf.set('WITH_@0@_@1@'.format(type, member), 1)
   endif
 endforeach
 
@@ -966,7 +966,7 @@ endforeach
 
 if host_machine.system() == 'linux' and cc.has_header('sys/acl.h')
   acl_dep = cc.find_library('acl', required: false)
-  conf.set('HAVE_SYS_ACL_H', 1)
+  conf.set('WITH_SYS_ACL_H', 1)
 else
   acl_dep = dependency('', required: false)
 endif
@@ -983,7 +983,7 @@ endif
 
 attr_dep = cc.find_library('attr', required: get_option('attr'))
 if attr_dep.found()
-  conf.set('HAVE_LIBATTR', 1)
+  conf.set('WITH_LIBATTR', 1)
 endif
 
 audit_dep = cc.find_library('audit', required: get_option('audit'))
@@ -1028,12 +1028,12 @@ if dbus_dep.found()
 
   function = 'dbus_watch_get_unix_fd'
   if cc.has_function(function, dependencies: dbus_dep)
-    conf.set('HAVE_@0@'.format(function.to_upper()), 1)
+    conf.set('WITH_@0@'.format(function.to_upper()), 1)
   endif
 
   type = 'DBusBasicValue'
   if cc.has_type(type, dependencies: dbus_dep, prefix: '#include <dbus/dbus.h>')
-    conf.set('HAVE_@0@'.format(type.to_upper()), 1)
+    conf.set('WITH_@0@'.format(type.to_upper()), 1)
   endif
 endif
 
@@ -1056,7 +1056,7 @@ if dlopen_dep.found()
   if not cc.has_header('dlfcn.h')
     error('Unable to find dlfcn.h')
   endif
-  conf.set('HAVE_DLFCN_H', 1)
+  conf.set('WITH_DLFCN_H', 1)
 endif
 
 fuse_version = '2.8.6'
@@ -1103,7 +1103,7 @@ if host_machine.system() == 'linux'
     libnl_dep = declare_dependency(
       dependencies: [ libnl_dep, libnl_route_dep ],
     )
-    conf.set('HAVE_LIBNL', 1)
+    conf.set('WITH_LIBNL', 1)
   endif
 else
   libnl_dep = dependency('', required: false)
@@ -1134,7 +1134,7 @@ if not libpcap_dep.found()
   endif
 endif
 if libpcap_dep.found()
-  conf.set('HAVE_LIBPCAP', 1)
+  conf.set('WITH_LIBPCAP', 1)
 endif
 
 libssh_version = '0.7'
@@ -1191,7 +1191,7 @@ if use_macvtap
   conf.set('WITH_MACVTAP', 1)
 
   if cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_PASSTHRU')
-    conf.set('HAVE_DECL_MACVLAN_MODE_PASSTHRU', 1)
+    conf.set('WITH_DECL_MACVLAN_MODE_PASSTHRU', 1)
   endif
 endif
 
@@ -1216,7 +1216,7 @@ if not get_option('nls').disabled()
   endif
 
   if cc.has_header('libintl.h')
-    conf.set('HAVE_LIBINTL_H', 1)
+    conf.set('WITH_LIBINTL_H', 1)
   elif get_option('nls').enabled()
     error('libintl.h is required to build libvirt')
   endif
@@ -1244,7 +1244,7 @@ if numactl_dep.found()
   conf.set('WITH_NUMACTL', 1)
 
   if cc.has_function('numa_bitmask_isbitset', dependencies: [ numactl_dep ])
-    conf.set('HAVE_NUMA_BITMASK_ISBITSET', 1)
+    conf.set('WITH_NUMA_BITMASK_ISBITSET', 1)
   endif
 endif
 
@@ -1270,7 +1270,7 @@ if rbd_dep.found() and not cc.has_function('rbd_get_features', dependencies: rbd
 endif
 if rbd_dep.found() and rados_dep.found()
   if cc.has_function('rbd_list2', dependencies: rbd_dep)
-    conf.set('HAVE_RBD_LIST2', 1)
+    conf.set('WITH_RBD_LIST2', 1)
   endif
 
   rbd_dep = declare_dependency(dependencies: [ rbd_dep, rados_dep ])
@@ -1350,7 +1350,7 @@ if not get_option('sanlock').disabled()
     conf.set('WITH_SANLOCK', 1)
     # check for sanlock_strerror introduced in sanlock-3.5.0
     if cc.has_function('sanlock_strerror', dependencies: sanlock_dep)
-      conf.set('HAVE_SANLOCK_STRERROR', 1)
+      conf.set('WITH_SANLOCK_STRERROR', 1)
     endif
   endif
 endif
@@ -1551,7 +1551,7 @@ elif get_option('firewalld_zone').enabled()
   error('You must have firewalld support enabled to enable firewalld_zone')
 endif
 
-if conf.has('WITH_MACVTAP') and not conf.has('HAVE_LIBNL')
+if conf.has('WITH_MACVTAP') and not conf.has('WITH_LIBNL')
   error('libnl3-devel is required for macvtap support')
 endif
 
@@ -1654,7 +1654,7 @@ if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD')
 
     # If building with libxl, use the libxl utility header and lib too
     if cc.has_header('libxlutil.h')
-      conf.set('HAVE_LIBXLUTIL_H', 1)
+      conf.set('WITH_LIBXLUTIL_H', 1)
     endif
     xl_util_dep = cc.find_library('xlutil')
 
@@ -1680,7 +1680,7 @@ if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD')
 
     # Check if Xen has support for PVH
     if cc.has_header_symbol('libxl.h', 'LIBXL_DOMAIN_TYPE_PVH')
-      conf.set('HAVE_XEN_PVH', 1)
+      conf.set('WITH_XEN_PVH', 1)
     endif
 
     conf.set('WITH_LIBXL', 1)
@@ -1701,7 +1701,7 @@ void main(void) {
   '''
   if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOURCE')
     conf.set('WITH_LXC', 1)
-    conf.set('HAVE_DECL_LO_FLAGS_AUTOCLEAR', 1)
+    conf.set('WITH_DECL_LO_FLAGS_AUTOCLEAR', 1)
   elif get_option('driver_lxc').enabled()
     error('Required kernel features for LXC were not found')
   endif
@@ -1716,7 +1716,7 @@ void main(void) {
 }
   '''
   if cc.compiles(lxc_get_free_code)
-    conf.set('HAVE_DECL_LOOP_CTL_GET_FREE', 1)
+    conf.set('WITH_DECL_LOOP_CTL_GET_FREE', 1)
   endif
 elif get_option('driver_lxc').enabled()
   error('linux and remote_driver are required for LXC')
@@ -2100,7 +2100,7 @@ endif
 
 driver_modules_flags = []
 if conf.has('WITH_LIBVIRTD')
-  if not conf.has('HAVE_DLFCN_H') or not dlopen_dep.found()
+  if not conf.has('WITH_DLFCN_H') or not dlopen_dep.found()
     error('You must have dlfcn.h / dlopen() support to build driver modules')
   endif
   driver_modules_flags = libvirt_export_dynamic
@@ -2177,7 +2177,7 @@ if not get_option('nss').disabled()
     conf.set('WITH_NSS', 1)
 
     if cc.has_type('struct gaih_addrtuple', prefix: '#include <nss.h>')
-      conf.set('HAVE_STRUCT_GAIH_ADDRTUPLE', 1)
+      conf.set('WITH_STRUCT_GAIH_ADDRTUPLE', 1)
     endif
 
     if (cc.has_type('ns_mtab', prefix: '#include <nsswitch.h>') and
@@ -2190,7 +2190,7 @@ endif
 if not get_option('numad').disabled() and numactl_dep.found()
   numad_prog = find_program('numad', required: get_option('numad'), dirs: libvirt_sbin_path)
   if numad_prog.found()
-    conf.set('HAVE_NUMAD', 1)
+    conf.set('WITH_NUMAD', 1)
     conf.set_quoted('NUMAD', numad_prog.path())
   endif
 elif get_option('numad').enabled()
@@ -2481,7 +2481,7 @@ misc_summary = {
   'Use -Werror': cc_flags.contains('-Werror'),
   'Warning Flags': supported_cc_flags,
   'DTrace': conf.has('WITH_DTRACE_PROBES'),
-  'numad': conf.has('HAVE_NUMAD'),
+  'numad': conf.has('WITH_NUMAD'),
   'Init script': init_script,
   'Char device locks': chrdev_lock_files,
   'Loader/NVRAM': loader_res,
index b7f21275cb9f0cf5f806144740718eb6c3bc4fc2..ad70d4f108f7cea3f64a2ade6d749f7b085ac582 100644 (file)
@@ -57,10 +57,10 @@ virAdmGlobalInit(void)
 
     virLogSetFromEnv();
 
-#ifdef HAVE_LIBINTL_H
+#ifdef WITH_LIBINTL_H
     if (!bindtextdomain(PACKAGE, LOCALEDIR))
         goto error;
-#endif /* HAVE_LIBINTL_H */
+#endif /* WITH_LIBINTL_H */
 
     if (!VIR_CLASS_NEW(remoteAdminPriv, virClassForObjectLockable()))
         goto error;
index 779da3dddbfa2ba6a70a9257c418811bcd2724a1..53794e8f6deafecbcc8b68edc988a22e44736cb3 100644 (file)
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if HAVE_NET_ETHERNET_H
+#if WITH_NET_ETHERNET_H
 # include <net/ethernet.h>
 #endif
 #include <unistd.h>
index 374a4d6f6c5584591d16825130def1c5b80fe7fd..939a3b8390327d04ab0383d6ec66e53694240c63 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <config.h>
 #if defined(__aarch64__)
-# if defined(HAVE_ASM_HWCAP_H)
+# if defined(WITH_ASM_HWCAP_H)
 #  include <asm/hwcap.h>
 # endif
 # include <sys/auxv.h>
@@ -520,7 +520,7 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data)
     int cpu_feature_index = 0;
     size_t i;
 
-# if defined(HAVE_GETAUXVAL)
+# if defined(WITH_GETAUXVAL)
     if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("CPUID registers unavailable"));
@@ -537,9 +537,9 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data)
     /* parse the corresponding vendor_id bits */
     data->vendor_id = (cpuid >> 24) & 0xff;
 
-# if defined(HAVE_GETAUXVAL)
+# if defined(WITH_GETAUXVAL)
     hwcaps = getauxval(AT_HWCAP);
-# elif defined(HAVE_ELF_AUX_INFO)
+# elif defined(WITH_ELF_AUX_INFO)
     elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long));
 # else
 #  error No routines to retrieve a value from the auxiliary vector
index 1a5ad2bfef96f9f72b5fb06a3ae6875241405ec8..d167e56b4897bcd0c8ad6d97c3316a470d2c9efe 100644 (file)
 /* The library itself needs to know enum sizes.  */
 #define VIR_ENUM_SENTINELS
 
-#ifdef HAVE_LIBINTL_H
+#ifdef WITH_LIBINTL_H
 # define DEFAULT_TEXT_DOMAIN PACKAGE
 # include <libintl.h>
 # define _(str) dgettext(PACKAGE, str)
-#else /* HAVE_LIBINTL_H */
+#else /* WITH_LIBINTL_H */
 # define _(str) str
-#endif /* HAVE_LIBINTL_H */
+#endif /* WITH_LIBINTL_H */
 #define N_(str) str
 
 #include "libvirt/libvirt.h"
     _Pragma ("GCC diagnostic push") \
     _Pragma ("GCC diagnostic ignored \"-Wpointer-sign\"")
 
-#if HAVE_SUGGEST_ATTRIBUTE_FORMAT
+#if WITH_SUGGEST_ATTRIBUTE_FORMAT
 # define VIR_WARNINGS_NO_PRINTF \
     _Pragma ("GCC diagnostic push") \
     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
index b2d0ba3d232a81d3f505a2dc0dbbdd1fc3e7b24d..39e465dd1c148cf4f6756d365255bc07f9fd2ce0 100644 (file)
@@ -242,10 +242,10 @@ virGlobalInit(void)
 
     g_networking_init();
 
-#ifdef HAVE_LIBINTL_H
+#ifdef WITH_LIBINTL_H
     if (!bindtextdomain(PACKAGE, LOCALEDIR))
         goto error;
-#endif /* HAVE_LIBINTL_H */
+#endif /* WITH_LIBINTL_H */
 
     /*
      * Note that the order is important: the first ones have a higher
index beac8c8cfc731ded116ba77e0364c08bc2d8435e..8284ea3d530721107399c481fb78f0f9c50ee661 100644 (file)
@@ -497,7 +497,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
              * HVM guest type. Add a PVH guest type for each new HVM
              * guest type.
              */
-#ifdef HAVE_XEN_PVH
+#ifdef WITH_XEN_PVH
             if (hvm && i == nr_guest_archs-1) {
                 /* Ensure we have not exhausted the guest_archs array */
                 if (nr_guest_archs >= G_N_ELEMENTS(guest_archs))
index ff0ddda62d37ed45f42db9a85205e44bd2b7e8ba..befd5eb96548c9cb41511992082b6044c380ec8e 100644 (file)
@@ -130,7 +130,7 @@ libxlMakeDomCreateInfo(libxl_ctx *ctx,
 
     if (def->os.type == VIR_DOMAIN_OSTYPE_HVM ||
         def->os.type == VIR_DOMAIN_OSTYPE_XENPVH) {
-#ifdef HAVE_XEN_PVH
+#ifdef WITH_XEN_PVH
         c_info->type = def->os.type == VIR_DOMAIN_OSTYPE_HVM ?
             LIBXL_DOMAIN_TYPE_HVM : LIBXL_DOMAIN_TYPE_PVH;
 #else
@@ -300,7 +300,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
     if (hvm) {
         libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM);
     } else if (pvh) {
-#ifdef HAVE_XEN_PVH
+#ifdef WITH_XEN_PVH
         libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PVH);
 #else
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
index 258aca5c73d2543e9e82e9bf065b27feb5df052f..30a8125f5ff8e275e46349a1a76586ee01e2400e 100644 (file)
@@ -46,7 +46,7 @@ VIR_LOG_INIT("xen.xen_xl");
  * corresponding header file wasn't.  Use the header file if detected during
  * configure, otherwise provide extern declarations for any functions used.
  */
-#ifdef HAVE_LIBXLUTIL_H
+#ifdef WITH_LIBXLUTIL_H
 # include <libxlutil.h>
 #else
 typedef struct XLU_Config XLU_Config;
index d4816030cf1a45282ff8cd3a19447be6972b77ee..640033eb972ff5f84a8d879cf1556dfdd674d690 100644 (file)
@@ -100,7 +100,7 @@ virLockManagerSanlockError(int err,
                            char **message)
 {
     if (err <= -200) {
-#if HAVE_SANLOCK_STRERROR
+#if WITH_SANLOCK_STRERROR
         *message = g_strdup(sanlock_strerror(err));
 #else
         *message = g_strdup_printf(_("sanlock error %d"), err);
index ada950e03e75a528028081ba0bee91e9f5448f01..07034b17996affeee4b5991360a12100b3d434f7 100644 (file)
@@ -30,7 +30,7 @@
 #include "viruuid.h"
 #include "virstring.h"
 
-#if HAVE_DLFCN_H
+#if WITH_DLFCN_H
 # include <dlfcn.h>
 #endif
 #include <unistd.h>
@@ -116,7 +116,7 @@ static void virLockManagerLogParams(size_t nparams,
  *
  * Returns a plugin object, or NULL if loading failed.
  */
-#if HAVE_DLFCN_H
+#if WITH_DLFCN_H
 virLockManagerPluginPtr virLockManagerPluginNew(const char *name,
                                                 const char *driverName,
                                                 const char *configDir,
@@ -191,7 +191,7 @@ virLockManagerPluginPtr virLockManagerPluginNew(const char *name,
         dlclose(handle);
     return NULL;
 }
-#else /* !HAVE_DLFCN_H */
+#else /* !WITH_DLFCN_H */
 virLockManagerPluginPtr
 virLockManagerPluginNew(const char *name G_GNUC_UNUSED,
                         const char *driverName G_GNUC_UNUSED,
@@ -202,7 +202,7 @@ virLockManagerPluginNew(const char *name G_GNUC_UNUSED,
                    _("this platform is missing dlopen"));
     return NULL;
 }
-#endif /* !HAVE_DLFCN_H */
+#endif /* !WITH_DLFCN_H */
 
 
 /**
@@ -227,7 +227,7 @@ void virLockManagerPluginRef(virLockManagerPluginPtr plugin)
  * result in an unsafe scenario.
  *
  */
-#if HAVE_DLFCN_H
+#if WITH_DLFCN_H
 void virLockManagerPluginUnref(virLockManagerPluginPtr plugin)
 {
     if (!plugin)
@@ -249,11 +249,11 @@ void virLockManagerPluginUnref(virLockManagerPluginPtr plugin)
     VIR_FREE(plugin->name);
     VIR_FREE(plugin);
 }
-#else /* !HAVE_DLFCN_H */
+#else /* !WITH_DLFCN_H */
 void virLockManagerPluginUnref(virLockManagerPluginPtr plugin G_GNUC_UNUSED)
 {
 }
-#endif /* !HAVE_DLFCN_H */
+#endif /* !WITH_DLFCN_H */
 
 
 const char *virLockManagerPluginGetName(virLockManagerPluginPtr plugin)
index 54cedd7325cd29747827037ce045a522bfa4dc2b..b016d86b9f55a8472cb4a9046609cfd156877172 100644 (file)
@@ -32,7 +32,7 @@
 #include <pwd.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
-#ifdef HAVE_SYSCTLBYNAME
+#ifdef WITH_SYSCTLBYNAME
 # include <sys/sysctl.h>
 #endif
 
@@ -2140,7 +2140,7 @@ networkEnableIPForwarding(bool enableIPv4,
                           bool enableIPv6)
 {
     int ret = 0;
-#ifdef HAVE_SYSCTLBYNAME
+#ifdef WITH_SYSCTLBYNAME
     int enabled = 1;
     if (enableIPv4)
         ret = sysctlbyname("net.inet.ip.forwarding", NULL, 0,
index 649c4441abd176e5cac864fc310b40a97a1856c0..d0992b782c85c5a755384bbc16f089307221f9b3 100644 (file)
@@ -36,7 +36,7 @@
  */
 #include <config.h>
 
-#ifdef HAVE_LIBPCAP
+#ifdef WITH_LIBPCAP
 # include <pcap.h>
 #endif
 
@@ -65,7 +65,7 @@
 
 VIR_LOG_INIT("nwfilter.nwfilter_dhcpsnoop");
 
-#ifdef HAVE_LIBPCAP
+#ifdef WITH_LIBPCAP
 
 # define LEASEFILE_DIR RUNSTATEDIR "/libvirt/network/"
 # define LEASEFILE LEASEFILE_DIR "nwfilter.leases"
@@ -2118,7 +2118,7 @@ virNWFilterDHCPSnoopShutdown(void)
     virNWFilterSnoopActiveUnlock();
 }
 
-#else /* HAVE_LIBPCAP */
+#else /* WITH_LIBPCAP */
 
 int
 virNWFilterDHCPSnoopInit(void)
@@ -2150,4 +2150,4 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver G_GNUC_UNUSED,
                      "='dhcp'\" requires it."));
     return -1;
 }
-#endif /* HAVE_LIBPCAP */
+#endif /* WITH_LIBPCAP */
index c28b12f2f0aa01f7f7f4c6ba024b61768d2360dc..faf66ac84aff8ed854519a32b218554987b8c21c 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_LIBPCAP
+#ifdef WITH_LIBPCAP
 # include <pcap.h>
 #endif
 
@@ -225,7 +225,7 @@ virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReqPtr req)
 }
 
 
-#if HAVE_LIBPCAP
+#if WITH_LIBPCAP
 
 static int
 virNWFilterRegisterLearnReq(virNWFilterIPAddrLearnReqPtr req)
@@ -306,7 +306,7 @@ freeLearnReqEntry(void *payload)
 }
 
 
-#ifdef HAVE_LIBPCAP
+#ifdef WITH_LIBPCAP
 
 static virNWFilterIPAddrLearnReqPtr
 virNWFilterDeregisterLearnReq(int ifindex)
@@ -325,7 +325,7 @@ virNWFilterDeregisterLearnReq(int ifindex)
 
 #endif
 
-#ifdef HAVE_LIBPCAP
+#ifdef WITH_LIBPCAP
 
 static void
 procDHCPOpts(struct dhcp *dhcp, int dhcp_opts_len,
@@ -761,7 +761,7 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver G_GNUC_UNUSED,
                      "support"));
     return -1;
 }
-#endif /* HAVE_LIBPCAP */
+#endif /* WITH_LIBPCAP */
 
 
 /**
index b6724a095f2082c0a8f248d7daac39f6067f0715..454d6a7b4d3574e4d04a5390cd836eb001d654c5 100644 (file)
@@ -24,7 +24,7 @@
 #ifdef __linux__
 # include <sys/sysmacros.h>
 #endif
-#if defined(HAVE_SYS_MOUNT_H)
+#if defined(WITH_SYS_MOUNT_H)
 # include <sys/mount.h>
 #endif
 #ifdef WITH_SELINUX
@@ -850,7 +850,7 @@ qemuDomainNamespaceAvailable(qemuDomainNamespace ns G_GNUC_UNUSED)
 
     switch (ns) {
     case QEMU_DOMAIN_NS_MOUNT:
-# if !defined(HAVE_SYS_ACL_H) || !defined(WITH_SELINUX)
+# if !defined(WITH_SYS_ACL_H) || !defined(WITH_SELINUX)
         /* We can't create the exact copy of paths if either of
          * these is not available. */
         return false;
index 222a1376c45b6adb9dc3c641fc1286b686d675a7..cfe09d6326336c5ab62b65b0f8e5bb1919fc2368 100644 (file)
@@ -2524,7 +2524,7 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet)
 /*
  * To be run between fork/exec of QEMU only
  */
-#if defined(HAVE_SCHED_GETAFFINITY) || defined(HAVE_BSD_CPU_AFFINITY)
+#if defined(WITH_SCHED_GETAFFINITY) || defined(WITH_BSD_CPU_AFFINITY)
 static int
 qemuProcessInitCpuAffinity(virDomainObjPtr vm)
 {
@@ -2577,13 +2577,13 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
 
     return 0;
 }
-#else /* !defined(HAVE_SCHED_GETAFFINITY) && !defined(HAVE_BSD_CPU_AFFINITY) */
+#else /* !defined(WITH_SCHED_GETAFFINITY) && !defined(WITH_BSD_CPU_AFFINITY) */
 static int
 qemuProcessInitCpuAffinity(virDomainObjPtr vm G_GNUC_UNUSED)
 {
     return 0;
 }
-#endif /* !defined(HAVE_SCHED_GETAFFINITY) && !defined(HAVE_BSD_CPU_AFFINITY) */
+#endif /* !defined(WITH_SCHED_GETAFFINITY) && !defined(WITH_BSD_CPU_AFFINITY) */
 
 /* set link states to down on interfaces at qemu start */
 static int
index f3aba01fd575a022c686109b1cafcede53e35835..90e0f7c47597c83d72fad284ed6032d119f06a80 100644 (file)
 #include <unistd.h>
 #include <signal.h>
 #include <fcntl.h>
-#ifdef HAVE_IFADDRS_H
+#ifdef WITH_IFADDRS_H
 # include <ifaddrs.h>
 #endif
 
-#ifdef HAVE_SYS_UCRED_H
+#ifdef WITH_SYS_UCRED_H
 # include <sys/ucred.h>
 #endif
 
@@ -182,7 +182,7 @@ virNetSocketCheckProtocolByLookup(const char *address,
 int virNetSocketCheckProtocols(bool *hasIPv4,
                                bool *hasIPv6)
 {
-#ifdef HAVE_IFADDRS_H
+#ifdef WITH_IFADDRS_H
     struct ifaddrs *ifaddr = NULL, *ifa;
 
     *hasIPv4 = *hasIPv6 = false;
@@ -1480,7 +1480,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
                                 pid_t *pid,
                                 unsigned long long *timestamp)
 {
-# if defined(HAVE_STRUCT_SOCKPEERCRED)
+# if defined(WITH_STRUCT_SOCKPEERCRED)
     struct sockpeercred cr;
 # else
     struct ucred cr;
index cb298419e6236cab987e2fafe6e0c920c9022cd9..09928fdc3c8d8e2854e38a239579876b1171de95 100644 (file)
@@ -580,7 +580,7 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
 }
 
 
-#ifdef HAVE_RBD_LIST2
+#ifdef WITH_RBD_LIST2
 static char **
 virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr)
 {
@@ -620,7 +620,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr)
     return NULL;
 }
 
-#else /* ! HAVE_RBD_LIST2 */
+#else /* ! WITH_RBD_LIST2 */
 
 static char **
 virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr)
@@ -669,7 +669,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr)
     virStringListFreeCount(names, nnames);
     return NULL;
 }
-#endif /* ! HAVE_RBD_LIST2 */
+#endif /* ! WITH_RBD_LIST2 */
 
 
 static int
index 7e82c09be52e64e59b00f669f0993978883c4938..9e79dbe1e4d4db2489c57b305e9ea6c616cecb9b 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/param.h>
 #include <fcntl.h>
 
-#if HAVE_PWD_H
+#if WITH_PWD_H
 # include <pwd.h>
 #endif
 
index d6a311c765d2265509d6267487e8fee1ed1a879b..cf82ea0a877eea8ef52323dbe686c827600795a9 100644 (file)
 
 #ifdef FICLONE
 # define REFLINK_IOC_CLONE FICLONE
-#elif HAVE_LINUX_BTRFS_H
+#elif WITH_LINUX_BTRFS_H
 # include <linux/btrfs.h>
 # define REFLINK_IOC_CLONE BTRFS_IOC_CLONE
-#elif HAVE_XFS_XFS_H
+#elif WITH_XFS_XFS_H
 # include <xfs/xfs.h>
 # define REFLINK_IOC_CLONE XFS_IOC_CLONE
 #endif
@@ -337,7 +337,7 @@ createRawFile(int fd, virStorageVolDefPtr vol,
     }
 
 /* Avoid issues with older kernel's <linux/fs.h> namespace pollution. */
-#if HAVE_FALLOCATE - 0
+#if WITH_FALLOCATE - 0
     /* Try to preallocate all requested disk space, but fall back to
      * other methods if this fails with ENOSYS or EOPNOTSUPP. If allocation
      * is 0 (or less than 0), then fallocate will fail with EINVAL.
index 342bae229b1b7ac56e5e8bf6713cb2d590749a6e..c3eb6f8c5445c38667665dd6986aa14b46b4112f 100644 (file)
@@ -56,7 +56,7 @@ runIO(const char *path, int fd, int oflags)
     bool direct = O_DIRECT && ((oflags & O_DIRECT) != 0);
     off_t end = 0;
 
-#if HAVE_POSIX_MEMALIGN
+#if WITH_POSIX_MEMALIGN
     if (posix_memalign(&base, alignMask + 1, buflen)) {
         virReportOOMError();
         goto cleanup;
index 987fc34ef46bbcdf4084ab79e90eb00ac41e2b9c..df4f33361466c13855d5270b6a73ca6684c2c9f5 100644 (file)
@@ -25,7 +25,7 @@ VIR_LOG_INIT("util.bpf");
 
 #define VIR_FROM_THIS VIR_FROM_BPF
 
-#if HAVE_SYS_SYSCALL_H && HAVE_DECL_BPF_PROG_QUERY
+#if WITH_SYS_SYSCALL_H && WITH_DECL_BPF_PROG_QUERY
 # include <sys/syscall.h>
 # include <unistd.h>
 
@@ -293,7 +293,7 @@ virBPFDeleteElem(int mapfd,
 }
 
 
-#else /* !HAVE_SYS_SYSCALL_H || !HAVE_DECL_BPF_PROG_QUERY */
+#else /* !WITH_SYS_SYSCALL_H || !WITH_DECL_BPF_PROG_QUERY */
 
 
 int
@@ -421,4 +421,4 @@ virBPFDeleteElem(int mapfd G_GNUC_UNUSED,
     errno = ENOSYS;
     return -1;
 }
-#endif /* !HAVE_SYS_SYSCALL_H || !HAVE_DECL_BPF_PROG_QUERY */
+#endif /* !WITH_SYS_SYSCALL_H || !WITH_DECL_BPF_PROG_QUERY */
index 1f38a683b9316864ddb6e4b10ad2a8e7c68318ee..1eafce86c0dd41bf2b56c9437a2ff5670bf9d36f 100644 (file)
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#if HAVE_DECL_BPF_PROG_QUERY
+#if WITH_DECL_BPF_PROG_QUERY
 
 # include <linux/bpf.h>
 
      .imm = 0, \
      })
 
-#else /* HAVE_DECL_BPF_PROG_QUERY */
+#else /* WITH_DECL_BPF_PROG_QUERY */
 
 struct bpf_prog_info;
 struct bpf_map_info;
@@ -191,7 +191,7 @@ struct bpf_insn;
 # define VIR_BPF_CALL_INSN(func)
 # define VIR_BPF_EXIT_INSN()
 
-#endif /* HAVE_DECL_BPF_PROG_QUERY */
+#endif /* WITH_DECL_BPF_PROG_QUERY */
 
 int
 virBPFCreateMap(unsigned int mapType,
index 234e0f227893c2f5ba1ef659f192c5eee2e00340..f31244f3c105b1d0700793f56e2ca873b4b746b9 100644 (file)
  */
 #include <config.h>
 
-#if HAVE_DECL_BPF_CGROUP_DEVICE
+#if WITH_DECL_BPF_CGROUP_DEVICE
 # include <fcntl.h>
 # include <linux/bpf.h>
 # include <sys/stat.h>
 # include <sys/syscall.h>
 # include <sys/types.h>
-#endif /* !HAVE_DECL_BPF_CGROUP_DEVICE */
+#endif /* !WITH_DECL_BPF_CGROUP_DEVICE */
 
 #include "internal.h"
 
@@ -41,7 +41,7 @@ VIR_LOG_INIT("util.cgroup");
 
 #define VIR_FROM_THIS VIR_FROM_CGROUP
 
-#if HAVE_DECL_BPF_CGROUP_DEVICE
+#if WITH_DECL_BPF_CGROUP_DEVICE
 bool
 virCgroupV2DevicesAvailable(virCgroupPtr group)
 {
@@ -581,7 +581,7 @@ virCgroupV2DevicesGetPerms(int perms,
 
     return ret;
 }
-#else /* !HAVE_DECL_BPF_CGROUP_DEVICE */
+#else /* !WITH_DECL_BPF_CGROUP_DEVICE */
 bool
 virCgroupV2DevicesAvailable(virCgroupPtr group G_GNUC_UNUSED)
 {
@@ -632,7 +632,7 @@ virCgroupV2DevicesGetPerms(int perms G_GNUC_UNUSED,
 {
     return 0;
 }
-#endif /* !HAVE_DECL_BPF_CGROUP_DEVICE */
+#endif /* !WITH_DECL_BPF_CGROUP_DEVICE */
 
 
 uint64_t
index fbfc09c9499b63753cf3bf0767111cb6c6fabac5..459b57abc65ae7c52d0088eec99e5149324ac724 100644 (file)
@@ -242,7 +242,7 @@ static dbus_bool_t virDBusAddWatch(DBusWatch *watch,
     if (dbus_watch_get_enabled(watch))
         flags = virDBusTranslateWatchFlags(dbus_watch_get_flags(watch));
 
-# if HAVE_DBUS_WATCH_GET_UNIX_FD
+# if WITH_DBUS_WATCH_GET_UNIX_FD
     fd = dbus_watch_get_unix_fd(watch);
 # else
     fd = dbus_watch_get_fd(watch);
index f96f393ff5d060972df1c4c39b4c33dbfb845479..5b4fe217f922fb2f525611e5d69bf9032ba66076 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "virdbus.h"
 
-#if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE
+#if defined(WITH_DBUS) && !WITH_DBUSBASICVALUE
 /* Copied (and simplified) from dbus 1.6.12, for use with older dbus headers */
 typedef union
 {
index 716bf6259313e24a2d79a002d6aaa8274f20f818..90156845dfb6001e78f914df7ad2f7b4eaf3a178 100644 (file)
 #ifndef WIN32
 # include <termios.h>
 #endif
-#ifdef HAVE_PTY_H
+#ifdef WITH_PTY_H
 /* Linux openpty */
 # include <pty.h>
 #endif
-#ifdef HAVE_UTIL_H
+#ifdef WITH_UTIL_H
 /* macOS openpty */
 # include <util.h>
 #endif
-#ifdef HAVE_LIBUTIL_H
+#ifdef WITH_LIBUTIL_H
 /* FreeBSD openpty */
 # include <libutil.h>
 #endif
 #include <sys/stat.h>
-#if defined(HAVE_SYS_MOUNT_H)
+#if defined(WITH_SYS_MOUNT_H)
 # include <sys/mount.h>
 #endif
 #include <unistd.h>
 #include <dirent.h>
-#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R
 # include <mntent.h>
 #endif
-#if HAVE_MMAP
+#if WITH_MMAP
 # include <sys/mman.h>
 #endif
-#if HAVE_SYS_SYSCALL_H
+#if WITH_SYS_SYSCALL_H
 # include <sys/syscall.h>
 #endif
-#if HAVE_SYS_ACL_H
+#if WITH_SYS_ACL_H
 # include <sys/acl.h>
 #endif
 #include <sys/file.h>
 
 #ifdef __linux__
-# if HAVE_LINUX_MAGIC_H
+# if WITH_LINUX_MAGIC_H
 #  include <linux/magic.h>
 # endif
 # include <sys/statfs.h>
-# if HAVE_DECL_LO_FLAGS_AUTOCLEAR
+# if WITH_DECL_LO_FLAGS_AUTOCLEAR
 #  include <linux/loop.h>
 # endif
 # include <sys/ioctl.h>
@@ -74,7 +74,7 @@
 # include <linux/fs.h>
 #endif
 
-#if HAVE_LIBATTR
+#if WITH_LIBATTR
 # include <sys/xattr.h>
 #endif
 
@@ -618,9 +618,9 @@ int virFileUpdatePerm(const char *path,
 }
 
 
-#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR
+#if defined(__linux__) && WITH_DECL_LO_FLAGS_AUTOCLEAR
 
-# if HAVE_DECL_LOOP_CTL_GET_FREE
+# if WITH_DECL_LOOP_CTL_GET_FREE
 
 /* virFileLoopDeviceOpenLoopCtl() returns -1 when a real failure has occurred
  * while in the process of allocating or opening the loop device.  On success
@@ -665,7 +665,7 @@ static int virFileLoopDeviceOpenLoopCtl(char **dev_name, int *fd)
     *dev_name = looppath;
     return 0;
 }
-# endif /* HAVE_DECL_LOOP_CTL_GET_FREE */
+# endif /* WITH_DECL_LOOP_CTL_GET_FREE */
 
 static int virFileLoopDeviceOpenSearch(char **dev_name)
 {
@@ -735,7 +735,7 @@ static int virFileLoopDeviceOpen(char **dev_name)
 {
     int loop_fd = -1;
 
-# if HAVE_DECL_LOOP_CTL_GET_FREE
+# if WITH_DECL_LOOP_CTL_GET_FREE
     if (virFileLoopDeviceOpenLoopCtl(dev_name, &loop_fd) < 0)
         return -1;
 
@@ -743,7 +743,7 @@ static int virFileLoopDeviceOpen(char **dev_name)
 
     if (loop_fd >= 0)
         return loop_fd;
-# endif /* HAVE_DECL_LOOP_CTL_GET_FREE */
+# endif /* WITH_DECL_LOOP_CTL_GET_FREE */
 
     /* Without the loop control device we just use the old technique. */
     loop_fd = virFileLoopDeviceOpenSearch(dev_name);
@@ -1082,7 +1082,7 @@ safewrite(int fd, const void *buf, size_t count)
     return nwritten;
 }
 
-#ifdef HAVE_POSIX_FALLOCATE
+#ifdef WITH_POSIX_FALLOCATE
 static int
 safezero_posix_fallocate(int fd, off_t offset, off_t len)
 {
@@ -1092,7 +1092,7 @@ safezero_posix_fallocate(int fd, off_t offset, off_t len)
     errno = ret;
     return -1;
 }
-#else /* !HAVE_POSIX_FALLOCATE */
+#else /* !WITH_POSIX_FALLOCATE */
 static int
 safezero_posix_fallocate(int fd G_GNUC_UNUSED,
                          off_t offset G_GNUC_UNUSED,
@@ -1100,9 +1100,9 @@ safezero_posix_fallocate(int fd G_GNUC_UNUSED,
 {
     return -2;
 }
-#endif /* !HAVE_POSIX_FALLOCATE */
+#endif /* !WITH_POSIX_FALLOCATE */
 
-#if HAVE_SYS_SYSCALL_H && defined(SYS_fallocate)
+#if WITH_SYS_SYSCALL_H && defined(SYS_fallocate)
 static int
 safezero_sys_fallocate(int fd,
                        off_t offset,
@@ -1110,7 +1110,7 @@ safezero_sys_fallocate(int fd,
 {
     return syscall(SYS_fallocate, fd, 0, offset, len);
 }
-#else /* !HAVE_SYS_SYSCALL_H || !defined(SYS_fallocate) */
+#else /* !WITH_SYS_SYSCALL_H || !defined(SYS_fallocate) */
 static int
 safezero_sys_fallocate(int fd G_GNUC_UNUSED,
                        off_t offset G_GNUC_UNUSED,
@@ -1118,9 +1118,9 @@ safezero_sys_fallocate(int fd G_GNUC_UNUSED,
 {
     return -2;
 }
-#endif /* !HAVE_SYS_SYSCALL_H || !defined(SYS_fallocate) */
+#endif /* !WITH_SYS_SYSCALL_H || !defined(SYS_fallocate) */
 
-#ifdef HAVE_MMAP
+#ifdef WITH_MMAP
 static int
 safezero_mmap(int fd, off_t offset, off_t len)
 {
@@ -1154,7 +1154,7 @@ safezero_mmap(int fd, off_t offset, off_t len)
      * example because of virtual memory limits) */
     return -2;
 }
-#else /* !HAVE_MMAP */
+#else /* !WITH_MMAP */
 static int
 safezero_mmap(int fd G_GNUC_UNUSED,
               off_t offset G_GNUC_UNUSED,
@@ -1162,7 +1162,7 @@ safezero_mmap(int fd G_GNUC_UNUSED,
 {
     return -2;
 }
-#endif /* !HAVE_MMAP */
+#endif /* !WITH_MMAP */
 
 static int
 safezero_slow(int fd, off_t offset, off_t len)
@@ -1226,7 +1226,7 @@ int virFileAllocate(int fd, off_t offset, off_t len)
     return safezero_sys_fallocate(fd, offset, len);
 }
 
-#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R
 /* search /proc/mounts for mount point of *type; return pointer to
  * malloc'ed string of the path if found, otherwise return NULL
  * with errno set to an appropriate value.
@@ -1259,7 +1259,7 @@ virFileFindMountPoint(const char *type)
     return ret;
 }
 
-#else /* defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
+#else /* defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */
 
 char *
 virFileFindMountPoint(const char *type G_GNUC_UNUSED)
@@ -1269,7 +1269,7 @@ virFileFindMountPoint(const char *type G_GNUC_UNUSED)
     return NULL;
 }
 
-#endif /* defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
+#endif /* defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */
 
 int
 virBuildPathInternal(char **path, ...)
@@ -1969,7 +1969,7 @@ virFileIsCDROM(const char *path)
 #endif /* defined(__linux__) */
 
 
-#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R
 static int
 virFileGetMountSubtreeImpl(const char *mtabpath,
                            const char *prefix,
@@ -2020,7 +2020,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath,
     endmntent(procmnt);
     return ret;
 }
-#else /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
+#else /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */
 static int
 virFileGetMountSubtreeImpl(const char *mtabpath G_GNUC_UNUSED,
                            const char *prefix G_GNUC_UNUSED,
@@ -2032,7 +2032,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath G_GNUC_UNUSED,
                          _("Unable to determine mount table on this platform"));
     return -1;
 }
-#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
+#endif /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */
 
 /**
  * virFileGetMountSubtree:
@@ -3691,7 +3691,7 @@ int virFileIsSharedFS(const char *path)
 }
 
 
-#if defined(__linux__) && defined(HAVE_SYS_MOUNT_H)
+#if defined(__linux__) && defined(WITH_SYS_MOUNT_H)
 int
 virFileSetupDev(const char *path,
                 const char *mount_options)
@@ -3761,7 +3761,7 @@ virFileMoveMount(const char *src,
 }
 
 
-#else /* !defined(__linux__) || !defined(HAVE_SYS_MOUNT_H) */
+#else /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */
 
 int
 virFileSetupDev(const char *path G_GNUC_UNUSED,
@@ -3791,10 +3791,10 @@ virFileMoveMount(const char *src G_GNUC_UNUSED,
                          _("mount move is not supported on this platform."));
     return -1;
 }
-#endif /* !defined(__linux__) || !defined(HAVE_SYS_MOUNT_H) */
+#endif /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */
 
 
-#if defined(HAVE_SYS_ACL_H)
+#if defined(WITH_SYS_ACL_H)
 int
 virFileGetACLs(const char *file,
                void **acl)
@@ -3824,7 +3824,7 @@ virFileFreeACLs(void **acl)
     *acl = NULL;
 }
 
-#else /* !defined(HAVE_SYS_ACL_H) */
+#else /* !defined(WITH_SYS_ACL_H) */
 
 int
 virFileGetACLs(const char *file G_GNUC_UNUSED,
@@ -3850,7 +3850,7 @@ virFileFreeACLs(void **acl)
     *acl = NULL;
 }
 
-#endif /* !defined(HAVE_SYS_ACL_H) */
+#endif /* !defined(WITH_SYS_ACL_H) */
 
 int
 virFileCopyACLs(const char *src,
@@ -3909,7 +3909,7 @@ virFileComparePaths(const char *p1, const char *p2)
 }
 
 
-#if HAVE_DECL_SEEK_HOLE
+#if WITH_DECL_SEEK_HOLE
 /**
  * virFileInData:
  * @fd: file to check
@@ -4027,7 +4027,7 @@ virFileInData(int fd,
     return ret;
 }
 
-#else /* !HAVE_DECL_SEEK_HOLE */
+#else /* !WITH_DECL_SEEK_HOLE */
 
 int
 virFileInData(int fd G_GNUC_UNUSED,
@@ -4040,7 +4040,7 @@ virFileInData(int fd G_GNUC_UNUSED,
     return -1;
 }
 
-#endif /* !HAVE_DECL_SEEK_HOLE */
+#endif /* !WITH_DECL_SEEK_HOLE */
 
 
 /**
@@ -4309,7 +4309,7 @@ virFileWaitForExists(const char *path,
 }
 
 
-#if HAVE_LIBATTR
+#if WITH_LIBATTR
 /**
  * virFileGetXAttrQuiet;
  * @path: a filename
@@ -4409,7 +4409,7 @@ virFileRemoveXAttr(const char *path,
     return 0;
 }
 
-#else /* !HAVE_LIBATTR */
+#else /* !WITH_LIBATTR */
 
 int
 virFileGetXAttrQuiet(const char *path G_GNUC_UNUSED,
@@ -4443,7 +4443,7 @@ virFileRemoveXAttr(const char *path,
     return -1;
 }
 
-#endif /* HAVE_LIBATTR */
+#endif /* WITH_LIBATTR */
 
 /**
  * virFileGetXAttr;
index 8de8edb23919a98f6c8cea169cad07c57e7c4b72..35dfba07fc32a30d19ae95cc560fe371a83428df 100644 (file)
@@ -21,7 +21,7 @@
 #include <config.h>
 
 #include <locale.h>
-#ifdef HAVE_XLOCALE_H
+#ifdef WITH_XLOCALE_H
 # include <xlocale.h>
 #endif
 
@@ -39,7 +39,7 @@
 int
 virGettextInitialize(void)
 {
-#if HAVE_LIBINTL_H
+#if WITH_LIBINTL_H
     if (!setlocale(LC_ALL, "")) {
         perror("setlocale");
         /* failure to setup locale is not fatal */
@@ -54,6 +54,6 @@ virGettextInitialize(void)
         perror("textdomain");
         return -1;
     }
-#endif /* HAVE_LIBINTL_H */
+#endif /* WITH_LIBINTL_H */
     return 0;
 }
index ebb91ebb54c94e692e3816afee1f81a1294913cf..f7e92cd924348378f99edf3da6d7f69d9d14ffee 100644 (file)
@@ -28,7 +28,7 @@
 #endif
 #include <unistd.h>
 
-#if HAVE_LINUX_KVM_H
+#if WITH_LINUX_KVM_H
 # include <linux/kvm.h>
 #endif
 
@@ -1129,7 +1129,7 @@ virHostCPUGetAvailableCPUsBitmap(void)
 }
 
 
-#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
+#if WITH_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
 
 /* Get the number of threads per subcore.
  *
@@ -1188,9 +1188,9 @@ virHostCPUGetThreadsPerSubcore(virArch arch G_GNUC_UNUSED)
     return 0;
 }
 
-#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
+#endif /* WITH_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
 
-#if HAVE_LINUX_KVM_H
+#if WITH_LINUX_KVM_H
 int
 virHostCPUGetKVMMaxVCPUs(void)
 {
@@ -1229,7 +1229,7 @@ virHostCPUGetKVMMaxVCPUs(void)
                          _("KVM is not supported on this platform"));
     return -1;
 }
-#endif /* HAVE_LINUX_KVM_H */
+#endif /* WITH_LINUX_KVM_H */
 
 
 #ifdef __linux__
@@ -1279,7 +1279,7 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED)
 #endif /* __linux__ */
 
 
-#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
+#if WITH_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
     (defined(__i386__) || defined(__x86_64__)) && \
     (defined(__linux__) || defined(__FreeBSD__))
 static int
@@ -1427,7 +1427,7 @@ virHostCPUGetTscInfo(void)
     return NULL;
 }
 
-#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
+#endif /* WITH_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
           (defined(__i386__) || defined(__x86_64__)) && \
           (defined(__linux__) || defined(__FreeBSD__)) */
 
index 27f192dc24fa8bdf0edd20d1d48551578ab8f0e9..ae42978ed29326f1dca2eb26d8067ee7b42e2b7d 100644 (file)
@@ -615,7 +615,7 @@ typedef WINBOOL(WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
 static unsigned long long
 virHostMemGetTotal(void)
 {
-#if defined HAVE_SYSCTLBYNAME
+#if defined WITH_SYSCTLBYNAME
     /* This works on freebsd & macOS. */
     unsigned long long physmem = 0;
     size_t len = sizeof(physmem);
@@ -676,7 +676,7 @@ virHostMemGetTotal(void)
 static unsigned long long
 virHostMemGetAvailable(void)
 {
-#if defined HAVE_SYSCTLBYNAME
+#if defined WITH_SYSCTLBYNAME
     /* This works on freebsd and macOS */
     unsigned long long usermem = 0;
     size_t len = sizeof(usermem);
index 661ed588cda9896a61553908f58c30801881b9ba..696a38fbb5fde11064537e97244ad7b1b615ad13 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_GETUTXID
+#ifdef WITH_GETUTXID
 # include <utmpx.h>
 #endif
 
@@ -82,11 +82,11 @@ virHostGetBootTimeProcfs(unsigned long long *btime)
 }
 #endif /* defined(__linux__) */
 
-#if defined(HAVE_GETUTXID) || defined(__linux__)
+#if defined(WITH_GETUTXID) || defined(__linux__)
 static void
 virHostGetBootTimeOnceInit(void)
 {
-# ifdef HAVE_GETUTXID
+# ifdef WITH_GETUTXID
     struct utmpx id = {.ut_type = BOOT_TIME};
     struct utmpx *res = NULL;
 
@@ -97,7 +97,7 @@ virHostGetBootTimeOnceInit(void)
     }
 
     endutxent();
-# endif /* HAVE_GETUTXID */
+# endif /* WITH_GETUTXID */
 
 # ifdef __linux__
     if (bootTimeErrno != 0 || bootTime == 0)
@@ -105,14 +105,14 @@ virHostGetBootTimeOnceInit(void)
 # endif /* __linux__ */
 }
 
-#else /* !defined(HAVE_GETUTXID) && !defined(__linux__) */
+#else /* !defined(WITH_GETUTXID) && !defined(__linux__) */
 
 static void
 virHostGetBootTimeOnceInit(void)
 {
     bootTimeErrno = ENOSYS;
 }
-#endif /* !defined(HAVE_GETUTXID) && !defined(__linux__) */
+#endif /* !defined(WITH_GETUTXID) && !defined(__linux__) */
 
 /**
  * virHostGetBootTime:
index 3217e5eb73272697fc7fa710aa4a186ace9a4e8d..f6d0c6c050b770d1264f62a97ade9c431131c71f 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#if HAVE_SYSLOG_H
+#if WITH_SYSLOG_H
 # include <syslog.h>
 #endif
 
@@ -45,7 +45,7 @@
 
 /* Journald output is only supported on Linux new enough to expose
  * htole64.  */
-#if HAVE_SYSLOG_H && defined(__linux__) && HAVE_DECL_HTOLE64
+#if WITH_SYSLOG_H && defined(__linux__) && WITH_DECL_HTOLE64
 # define USE_JOURNALD 1
 # include <sys/uio.h>
 #endif
@@ -705,7 +705,7 @@ virLogNewOutputToFile(virLogPriority priority,
 }
 
 
-#if HAVE_SYSLOG_H || USE_JOURNALD
+#if WITH_SYSLOG_H || USE_JOURNALD
 
 /* Compat in case we build with journald, but no syslog */
 # ifndef LOG_DEBUG
@@ -737,10 +737,10 @@ virLogPrioritySyslog(virLogPriority priority)
         return LOG_ERR;
     }
 }
-#endif /* HAVE_SYSLOG_H || USE_JOURNALD */
+#endif /* WITH_SYSLOG_H || USE_JOURNALD */
 
 
-#if HAVE_SYSLOG_H
+#if WITH_SYSLOG_H
 static void
 virLogOutputToSyslog(virLogSourcePtr source G_GNUC_UNUSED,
                      virLogPriority priority,
@@ -1042,12 +1042,12 @@ int virLogPriorityFromSyslog(int priority)
     return VIR_LOG_ERROR;
 }
 
-#else /* HAVE_SYSLOG_H */
+#else /* WITH_SYSLOG_H */
 int virLogPriorityFromSyslog(int priority G_GNUC_UNUSED)
 {
     return VIR_LOG_ERROR;
 }
-#endif /* HAVE_SYSLOG_H */
+#endif /* WITH_SYSLOG_H */
 
 
 /**
@@ -1383,10 +1383,10 @@ virLogFindOutput(virLogOutputPtr *outputs, size_t noutputs,
 int
 virLogDefineOutputs(virLogOutputPtr *outputs, size_t noutputs)
 {
-#if HAVE_SYSLOG_H
+#if WITH_SYSLOG_H
     int id;
     char *tmp = NULL;
-#endif /* HAVE_SYSLOG_H */
+#endif /* WITH_SYSLOG_H */
 
     if (virLogInitialize() < 0)
         return -1;
@@ -1394,7 +1394,7 @@ virLogDefineOutputs(virLogOutputPtr *outputs, size_t noutputs)
     virLogLock();
     virLogResetOutputs();
 
-#if HAVE_SYSLOG_H
+#if WITH_SYSLOG_H
     /* syslog needs to be special-cased, since it keeps the fd in private */
     if ((id = virLogFindOutput(outputs, noutputs, VIR_LOG_TO_SYSLOG,
                                current_ident)) != -1) {
@@ -1407,7 +1407,7 @@ virLogDefineOutputs(virLogOutputPtr *outputs, size_t noutputs)
         current_ident = tmp;
         openlog(current_ident, 0, 0);
     }
-#endif /* HAVE_SYSLOG_H */
+#endif /* WITH_SYSLOG_H */
 
     virLogOutputs = outputs;
     virLogNbOutputs = noutputs;
@@ -1519,7 +1519,7 @@ virLogParseOutput(const char *src)
         ret = virLogNewOutputToStderr(prio);
         break;
     case VIR_LOG_TO_SYSLOG:
-#if HAVE_SYSLOG_H
+#if WITH_SYSLOG_H
         ret = virLogNewOutputToSyslog(prio, tokens[2]);
 #endif
         break;
index bc05fc6f4d41063e8c9407ca156991a9d612ec46..36cf77ac4672f3e6a1439f7f0dd5a0559e8a91bd 100644 (file)
@@ -32,7 +32,7 @@
 
 VIR_LOG_INIT("util.module");
 
-#ifdef HAVE_DLFCN_H
+#ifdef WITH_DLFCN_H
 # include <dlfcn.h>
 
 static void *
@@ -141,7 +141,7 @@ virModuleLoad(const char *path,
     return ret;
 }
 
-#else /* ! HAVE_DLFCN_H */
+#else /* ! WITH_DLFCN_H */
 int
 virModuleLoad(const char *path,
               const char *regfunc G_GNUC_UNUSED,
@@ -160,4 +160,4 @@ virModuleLoad(const char *path,
         return 1;
     }
 }
-#endif /* ! HAVE_DLFCN_H */
+#endif /* ! WITH_DLFCN_H */
index b42fa8667202f62b73662c42e7dde1f1bf38aea0..3040f129d1594d308bc8cc53d5573b53756858de 100644 (file)
 # include <linux/sockios.h>
 # include <linux/if_vlan.h>
 # define VIR_NETDEV_FAMILY AF_UNIX
-#elif defined(HAVE_STRUCT_IFREQ) && defined(AF_LOCAL)
+#elif defined(WITH_STRUCT_IFREQ) && defined(AF_LOCAL)
 # define VIR_NETDEV_FAMILY AF_LOCAL
 #else
-# undef HAVE_STRUCT_IFREQ
+# undef WITH_STRUCT_IFREQ
 #endif
 
-#if defined(SIOCETHTOOL) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCETHTOOL) && defined(WITH_STRUCT_IFREQ)
 # include <linux/types.h>
 # include <linux/ethtool.h>
 #endif
 
-#if HAVE_DECL_LINK_ADDR
+#if WITH_DECL_LINK_ADDR
 # include <sys/sockio.h>
 # include <net/if_dl.h>
 #endif
 
-#if HAVE_LINUX_DEVLINK_H
+#if WITH_LINUX_DEVLINK_H
 # include <linux/devlink.h>
 #endif
 
@@ -73,7 +73,7 @@ VIR_LOG_INIT("util.netdev");
 #define VIR_MCAST_NAME_LEN (IFNAMSIZ + 1)
 #define VIR_MCAST_TOKEN_DELIMS " \n"
 
-#if defined(SIOCSIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCSIFFLAGS) && defined(WITH_STRUCT_IFREQ)
 # define VIR_IFF_UP IFF_UP
 # define VIR_IFF_PROMISC IFF_PROMISC
 # define VIR_IFF_MULTICAST IFF_MULTICAST
@@ -86,7 +86,7 @@ VIR_LOG_INIT("util.netdev");
 #endif
 
 #define RESOURCE_FILE_LEN 4096
-#if HAVE_DECL_ETHTOOL_GFEATURES
+#if WITH_DECL_ETHTOOL_GFEATURES
 # define TX_UDP_TNL 25
 # define GFEATURES_SIZE 2
 # define FEATURE_WORD(blocks, index, field)  ((blocks)[(index) / 32U].field)
@@ -130,7 +130,7 @@ struct _virNetDevMcastList {
     virNetDevMcastEntryPtr *entries;
 };
 
-#if defined(HAVE_STRUCT_IFREQ)
+#if defined(WITH_STRUCT_IFREQ)
 static int virNetDevSetupControlFull(const char *ifname,
                                      struct ifreq *ifr,
                                      int domain,
@@ -172,7 +172,7 @@ virNetDevSetupControl(const char *ifname,
 {
     return virNetDevSetupControlFull(ifname, ifr, VIR_NETDEV_FAMILY, SOCK_DGRAM);
 }
-#else /* !HAVE_STRUCT_IFREQ */
+#else /* !WITH_STRUCT_IFREQ */
 int
 virNetDevSetupControl(const char *ifname G_GNUC_UNUSED,
                       void *ifr G_GNUC_UNUSED)
@@ -182,10 +182,10 @@ virNetDevSetupControl(const char *ifname G_GNUC_UNUSED,
                            "on this platform"));
     return -1;
 }
-#endif /* HAVE_STRUCT_IFREQ */
+#endif /* WITH_STRUCT_IFREQ */
 
 
-#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFFLAGS) && defined(WITH_STRUCT_IFREQ)
 /**
  * virNetDevExists:
  * @ifname
@@ -224,7 +224,7 @@ int virNetDevExists(const char *ifname)
 
 
 #if defined(SIOCGIFHWADDR) && defined(SIOCSIFHWADDR) && \
-    defined(HAVE_STRUCT_IFREQ)
+    defined(WITH_STRUCT_IFREQ)
 /**
  * virNetDevSetMACInternal:
  * @ifname: interface name to set MTU for
@@ -282,8 +282,8 @@ virNetDevSetMACInternal(const char *ifname,
 }
 
 
-#elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \
-    HAVE_DECL_LINK_ADDR
+#elif defined(SIOCSIFLLADDR) && defined(WITH_STRUCT_IFREQ) && \
+    WITH_DECL_LINK_ADDR
 
 
 static int
@@ -350,7 +350,7 @@ virNetDevSetMAC(const char *ifname,
 }
 
 
-#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFHWADDR) && defined(WITH_STRUCT_IFREQ)
 /**
  * virNetDevGetMAC:
  * @ifname: interface name to set MTU for
@@ -392,7 +392,7 @@ int virNetDevGetMAC(const char *ifname,
 #endif
 
 
-#if defined(SIOCGIFMTU) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFMTU) && defined(WITH_STRUCT_IFREQ)
 /**
  * virNetDevGetMTU:
  * @ifname: interface name get MTU for
@@ -429,7 +429,7 @@ int virNetDevGetMTU(const char *ifname)
 #endif
 
 
-#if defined(SIOCSIFMTU) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCSIFMTU) && defined(WITH_STRUCT_IFREQ)
 /**
  * virNetDevSetMTU:
  * @ifname: interface name to set MTU for
@@ -534,7 +534,7 @@ int virNetDevSetNamespace(const char *ifname, pid_t pidInNs)
     return 0;
 }
 
-#if defined(SIOCSIFNAME) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCSIFNAME) && defined(WITH_STRUCT_IFREQ)
 /**
  * virNetDevSetName:
  * @ifname: name of device
@@ -552,7 +552,7 @@ int virNetDevSetName(const char* ifname, const char *newifname)
     if ((fd = virNetDevSetupControl(ifname, &ifr)) < 0)
         return -1;
 
-# ifdef HAVE_STRUCT_IFREQ_IFR_NEWNAME
+# ifdef WITH_STRUCT_IFREQ_IFR_NEWNAME
     if (virStrcpyStatic(ifr.ifr_newname, newifname) < 0) {
         virReportSystemError(ERANGE,
                              _("Network interface name '%s' is too long"),
@@ -583,7 +583,7 @@ int virNetDevSetName(const char* ifname, const char *newifname)
 #endif
 
 
-#if defined(SIOCSIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCSIFFLAGS) && defined(WITH_STRUCT_IFREQ)
 static int
 virNetDevSetIFFlag(const char *ifname, int flag, bool val)
 {
@@ -704,7 +704,7 @@ virNetDevSetRcvAllMulti(const char *ifname,
 }
 
 
-#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFFLAGS) && defined(WITH_STRUCT_IFREQ)
 static int
 virNetDevGetIFFlag(const char *ifname, int flag, bool *val)
 {
@@ -805,7 +805,7 @@ virNetDevGetRcvAllMulti(const char *ifname,
     return virNetDevGetIFFlag(ifname, VIR_IFF_ALLMULTI, receive);
 }
 
-#if defined(HAVE_IF_INDEXTONAME)
+#if defined(WITH_IF_INDEXTONAME)
 char *virNetDevGetName(int ifindex)
 {
     char name[IFNAMSIZ];
@@ -840,7 +840,7 @@ char *virNetDevGetName(int ifindex)
  *
  * Returns 0 on success, -1 on failure
  */
-#if defined(SIOCGIFINDEX) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFINDEX) && defined(WITH_STRUCT_IFREQ)
 int virNetDevGetIndex(const char *ifname, int *ifindex)
 {
     struct ifreq ifreq;
@@ -867,7 +867,7 @@ int virNetDevGetIndex(const char *ifname, int *ifindex)
         return -1;
     }
 
-# ifdef HAVE_STRUCT_IFREQ_IFR_INDEX
+# ifdef WITH_STRUCT_IFREQ_IFR_INDEX
     *ifindex = ifreq.ifr_index;
 # else
     *ifindex = ifreq.ifr_ifindex;
@@ -885,7 +885,7 @@ int virNetDevGetIndex(const char *ifname G_GNUC_UNUSED,
 #endif /* ! SIOCGIFINDEX */
 
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 /**
  * virNetDevGetMaster:
  * @ifname: name of interface we're interested in
@@ -929,10 +929,10 @@ virNetDevGetMaster(const char *ifname G_GNUC_UNUSED,
 }
 
 
-#endif /* defined(__linux__) && defined(HAVE_LIBNL) */
+#endif /* defined(__linux__) && defined(WITH_LIBNL) */
 
 
-#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && HAVE_DECL_GET_VLAN_VID_CMD
+#if defined(SIOCGIFVLAN) && defined(WITH_STRUCT_IFREQ) && WITH_DECL_GET_VLAN_VID_CMD
 int virNetDevGetVLanID(const char *ifname, int *vlanid)
 {
     struct vlan_ioctl_args vlanargs = {
@@ -985,7 +985,7 @@ int virNetDevGetVLanID(const char *ifname G_GNUC_UNUSED,
  *
  * Returns 1 if the config matches, 0 if the config does not match, or interface does not exist, -1 on error
  */
-#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFHWADDR) && defined(WITH_STRUCT_IFREQ)
 int virNetDevValidateConfig(const char *ifname,
                             const virMacAddr *macaddr, int ifindex)
 {
@@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC_UNUSED,
 
 
 #endif /* !__linux__ */
-#if defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX)
+#if defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX)
 
 
 static virMacAddr zeroMAC = { .addr = { 0, 0, 0, 0, 0, 0 } };
@@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
 }
 
 
-#else /* defined(__linux__) && defined(HAVE_LIBNL)  && defined(IFLA_VF_MAX) */
+#else /* defined(__linux__) && defined(WITH_LIBNL)  && defined(IFLA_VF_MAX) */
 
 
 int
@@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED,
 }
 
 
-#endif /* defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX) */
+#endif /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) */
 
 VIR_ENUM_IMPL(virNetDevIfState,
               VIR_NETDEV_IF_STATE_LAST,
@@ -2442,8 +2442,8 @@ virNetDevGetLinkInfo(const char *ifname,
 #endif /* defined(__linux__) */
 
 
-#if defined(SIOCADDMULTI) && defined(HAVE_STRUCT_IFREQ) && \
-    defined(HAVE_STRUCT_IFREQ_IFR_HWADDR)
+#if defined(SIOCADDMULTI) && defined(WITH_STRUCT_IFREQ) && \
+    defined(WITH_STRUCT_IFREQ_IFR_HWADDR)
 /**
  * virNetDevAddMulti:
  * @ifname: interface name to which to add multicast MAC address
@@ -2487,8 +2487,8 @@ int virNetDevAddMulti(const char *ifname G_GNUC_UNUSED,
 }
 #endif
 
-#if defined(SIOCDELMULTI) && defined(HAVE_STRUCT_IFREQ) && \
-    defined(HAVE_STRUCT_IFREQ_IFR_HWADDR)
+#if defined(SIOCDELMULTI) && defined(WITH_STRUCT_IFREQ) && \
+    defined(WITH_STRUCT_IFREQ_IFR_HWADDR)
 /**
  * virNetDevDelMulti:
  * @ifname: interface name from which to delete the multicast MAC address
@@ -2780,7 +2780,7 @@ int virNetDevGetRxFilter(const char *ifname,
     return ret;
 }
 
-#if defined(SIOCETHTOOL) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCETHTOOL) && defined(WITH_STRUCT_IFREQ)
 
 /**
  * virNetDevRDMAFeature
@@ -2912,28 +2912,28 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap,
         {ETHTOOL_GTXCSUM, VIR_NET_DEV_FEAT_GTXCSUM},
         {ETHTOOL_GSG, VIR_NET_DEV_FEAT_GSG},
         {ETHTOOL_GTSO, VIR_NET_DEV_FEAT_GTSO},
-# if HAVE_DECL_ETHTOOL_GGSO
+# if WITH_DECL_ETHTOOL_GGSO
         {ETHTOOL_GGSO, VIR_NET_DEV_FEAT_GGSO},
 # endif
-# if HAVE_DECL_ETHTOOL_GGRO
+# if WITH_DECL_ETHTOOL_GGRO
         {ETHTOOL_GGRO, VIR_NET_DEV_FEAT_GGRO},
 # endif
     };
 
-# if HAVE_DECL_ETHTOOL_GFLAGS
+# if WITH_DECL_ETHTOOL_GFLAGS
     /* ethtool masks */
     struct virNetDevEthtoolFeatureCmd flags[] = {
-#  if HAVE_DECL_ETH_FLAG_LRO
+#  if WITH_DECL_ETH_FLAG_LRO
         {ETH_FLAG_LRO, VIR_NET_DEV_FEAT_LRO},
 #  endif
-#  if HAVE_DECL_ETH_FLAG_TXVLAN
+#  if WITH_DECL_ETH_FLAG_TXVLAN
         {ETH_FLAG_RXVLAN, VIR_NET_DEV_FEAT_RXVLAN},
         {ETH_FLAG_TXVLAN, VIR_NET_DEV_FEAT_TXVLAN},
 #  endif
-#  if HAVE_DECL_ETH_FLAG_NTUBLE
+#  if WITH_DECL_ETH_FLAG_NTUBLE
         {ETH_FLAG_NTUPLE, VIR_NET_DEV_FEAT_NTUPLE},
 #  endif
-#  if HAVE_DECL_ETH_FLAG_RXHASH
+#  if WITH_DECL_ETH_FLAG_RXHASH
         {ETH_FLAG_RXHASH, VIR_NET_DEV_FEAT_RXHASH},
 #  endif
     };
@@ -2945,7 +2945,7 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap,
             ignore_value(virBitmapSetBit(bitmap, ethtool_cmds[i].feat));
     }
 
-# if HAVE_DECL_ETHTOOL_GFLAGS
+# if WITH_DECL_ETHTOOL_GFLAGS
     cmd.cmd = ETHTOOL_GFLAGS;
     if (virNetDevFeatureAvailable(fd, ifr, &cmd)) {
         for (i = 0; i < G_N_ELEMENTS(flags); i++) {
@@ -2957,7 +2957,7 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap,
 }
 
 
-# if HAVE_DECL_DEVLINK_CMD_ESWITCH_GET
+# if WITH_DECL_DEVLINK_CMD_ESWITCH_GET
 
 /**
  * virNetDevGetFamilyId:
@@ -3121,7 +3121,7 @@ virNetDevSwitchdevFeature(const char *ifname G_GNUC_UNUSED,
 # endif
 
 
-# if HAVE_DECL_ETHTOOL_GFEATURES
+# if WITH_DECL_ETHTOOL_GFEATURES
 /**
  * virNetDevGFeatureAvailable
  * This function checks for the availability of a network device gfeature
@@ -3172,7 +3172,7 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap G_GNUC_UNUSED,
 # endif
 
 
-# if HAVE_DECL_ETHTOOL_SCOALESCE && HAVE_DECL_ETHTOOL_GCOALESCE
+# if WITH_DECL_ETHTOOL_SCOALESCE && WITH_DECL_ETHTOOL_GCOALESCE
 /**
  * virNetDevSetCoalesce:
  * @ifname: interface name to modify
index 55e3948afd827d62d4c31c6235ef1def59e60c8b..5f581323ed9f21b4b48d6e2737b768e71d2c6535 100644 (file)
 #include "virnetdevvlan.h"
 #include "virenum.h"
 
-#ifdef HAVE_NET_IF_H
+#ifdef WITH_NET_IF_H
 # include <net/if.h>
 #endif
 
-#ifdef HAVE_STRUCT_IFREQ
+#ifdef WITH_STRUCT_IFREQ
 typedef struct ifreq virIfreq;
 #else
 typedef void virIfreq;
index ccac97e8d08574e70c50abb3666865e221655fb8..9fec770fb6650a4328acf6271b7fa3e7bf6bbbc9 100644 (file)
 #include "virstring.h"
 #include "virsocket.h"
 
-#ifdef HAVE_NET_IF_H
+#ifdef WITH_NET_IF_H
 # include <net/if.h>
 #endif
 
 #ifdef __linux__
-# if defined(HAVE_LIBNL)
+# if defined(WITH_LIBNL)
 #  include "virnetlink.h"
 # endif
 # include <linux/sockios.h>
@@ -62,7 +62,7 @@
 # define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000)
 #endif
 
-#if defined(HAVE_BSD_BRIDGE_MGMT)
+#if defined(WITH_BSD_BRIDGE_MGMT)
 # include <net/ethernet.h>
 # include <net/if_bridgevar.h>
 #endif
@@ -71,7 +71,7 @@
 
 VIR_LOG_INIT("util.netdevbridge");
 
-#if defined(HAVE_BSD_BRIDGE_MGMT)
+#if defined(WITH_BSD_BRIDGE_MGMT)
 static int virNetDevBridgeCmd(const char *brname,
                               u_long op,
                               void *arg,
@@ -103,7 +103,7 @@ static int virNetDevBridgeCmd(const char *brname,
 }
 #endif
 
-#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
+#if defined(WITH_STRUCT_IFREQ) && defined(__linux__)
 /*
  * Bridge parameters can be set via sysfs on newish kernels,
  * or by  ioctl on older kernels. Perhaps we could just use
@@ -412,7 +412,7 @@ virNetDevBridgePortSetIsolated(const char *brname G_GNUC_UNUSED,
  *
  * Returns 0 in case of success or -1 on failure
  */
-#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR)
+#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR)
 static int
 virNetDevBridgeCreateWithIoctl(const char *brname,
                                const virMacAddr *mac)
@@ -441,7 +441,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname,
 }
 #endif
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 int
 virNetDevBridgeCreate(const char *brname,
                       const virMacAddr *mac)
@@ -454,7 +454,7 @@ virNetDevBridgeCreate(const char *brname,
 
 
     if (virNetlinkNewLink(brname, "bridge", &data, &error) < 0) {
-# if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR)
+# if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR)
         if (error == -EOPNOTSUPP) {
             /* fallback to ioctl if netlink doesn't support creating bridges */
             return virNetDevBridgeCreateWithIoctl(brname, mac);
@@ -471,7 +471,7 @@ virNetDevBridgeCreate(const char *brname,
 }
 
 
-#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR)
+#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR)
 int
 virNetDevBridgeCreate(const char *brname,
                       const virMacAddr *mac)
@@ -480,7 +480,7 @@ virNetDevBridgeCreate(const char *brname,
 }
 
 
-#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCIFCREATE2)
+#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCIFCREATE2)
 int
 virNetDevBridgeCreate(const char *brname,
                       const virMacAddr *mac)
@@ -530,7 +530,7 @@ virNetDevBridgeCreate(const char *brname,
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
-#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR)
+#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELBR)
 static int
 virNetDevBridgeDeleteWithIoctl(const char *brname)
 {
@@ -552,7 +552,7 @@ virNetDevBridgeDeleteWithIoctl(const char *brname)
 #endif
 
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 int
 virNetDevBridgeDelete(const char *brname)
 {
@@ -560,7 +560,7 @@ virNetDevBridgeDelete(const char *brname)
      * deleting a bridge even if it is currently IFF_UP. fallback to
      * using ioctl(SIOCBRDELBR) if netlink fails with EOPNOTSUPP.
      */
-# if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR)
+# if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELBR)
     return virNetlinkDelLink(brname, virNetDevBridgeDeleteWithIoctl);
 # else
     return virNetlinkDelLink(brname, NULL);
@@ -568,7 +568,7 @@ virNetDevBridgeDelete(const char *brname)
 }
 
 
-#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR)
+#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELBR)
 int
 virNetDevBridgeDelete(const char *brname)
 {
@@ -576,7 +576,7 @@ virNetDevBridgeDelete(const char *brname)
 }
 
 
-#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCIFDESTROY)
+#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCIFDESTROY)
 int
 virNetDevBridgeDelete(const char *brname)
 {
@@ -613,7 +613,7 @@ int virNetDevBridgeDelete(const char *brname G_GNUC_UNUSED)
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
-#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDIF)
+#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDIF)
 int virNetDevBridgeAddPort(const char *brname,
                            const char *ifname)
 {
@@ -637,7 +637,7 @@ int virNetDevBridgeAddPort(const char *brname,
 
     return 0;
 }
-#elif defined(HAVE_BSD_BRIDGE_MGMT)
+#elif defined(WITH_BSD_BRIDGE_MGMT)
 int virNetDevBridgeAddPort(const char *brname,
                            const char *ifname)
 {
@@ -678,7 +678,7 @@ int virNetDevBridgeAddPort(const char *brname,
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
-#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELIF)
+#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELIF)
 int virNetDevBridgeRemovePort(const char *brname,
                               const char *ifname)
 {
@@ -703,7 +703,7 @@ int virNetDevBridgeRemovePort(const char *brname,
 
     return 0;
 }
-#elif defined(HAVE_BSD_BRIDGE_MGMT)
+#elif defined(WITH_BSD_BRIDGE_MGMT)
 int virNetDevBridgeRemovePort(const char *brname,
                               const char *ifname)
 {
@@ -736,7 +736,7 @@ int virNetDevBridgeRemovePort(const char *brname,
 #endif
 
 
-#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
+#if defined(WITH_STRUCT_IFREQ) && defined(__linux__)
 /**
  * virNetDevBridgeSetSTPDelay:
  * @brname: the bridge name
@@ -830,7 +830,7 @@ int virNetDevBridgeGetSTP(const char *brname,
 
     return ret;
 }
-#elif defined(HAVE_BSD_BRIDGE_MGMT)
+#elif defined(WITH_BSD_BRIDGE_MGMT)
 int virNetDevBridgeSetSTPDelay(const char *brname,
                                int delay)
 {
@@ -911,7 +911,7 @@ int virNetDevBridgeGetSTP(const char *brname,
 }
 #endif
 
-#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
+#if defined(WITH_STRUCT_IFREQ) && defined(__linux__)
 /**
  * virNetDevBridgeGetVlanFiltering:
  * @brname: the bridge device name
@@ -976,7 +976,7 @@ virNetDevBridgeSetVlanFiltering(const char *brname G_GNUC_UNUSED,
 #endif
 
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 
 # ifndef NTF_SELF
 #  define NTF_SELF 0x02
index 8c66baa884746d78264c0db0ca5dbec012a79095..1e7e64f8f37e14167b22f410b9ab6f9bd727d608 100644 (file)
 #include "vircommand.h"
 #include "viralloc.h"
 
-#if HAVE_GETIFADDRS
+#if WITH_GETIFADDRS
 # include <ifaddrs.h>
 #endif
 
 #ifndef WIN32
 # include <sys/ioctl.h>
 #endif
-#ifdef HAVE_NET_IF_H
+#ifdef WITH_NET_IF_H
 # include <net/if.h>
 #endif
 #include <fcntl.h>
@@ -51,7 +51,7 @@
 
 VIR_LOG_INIT("util.netdevip");
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 
 static int
 virNetDevGetIPAddressBinary(virSocketAddr *addr, void **data, size_t *len)
@@ -676,7 +676,7 @@ virNetDevIPCheckIPv6Forwarding(void)
     return valid;
 }
 
-#else /* defined(__linux__) && defined(HAVE_LIBNL) */
+#else /* defined(__linux__) && defined(WITH_LIBNL) */
 
 
 int
@@ -815,7 +815,7 @@ virNetDevIPCheckIPv6Forwarding(void)
     return true;
 }
 
-#endif /* defined(__linux__) && defined(HAVE_LIBNL) */
+#endif /* defined(__linux__) && defined(WITH_LIBNL) */
 
 
 /**
@@ -828,7 +828,7 @@ virNetDevIPCheckIPv6Forwarding(void)
  *
  * Returns 0 on success, -errno on failure.
  */
-#if defined(SIOCGIFADDR) && defined(HAVE_STRUCT_IFREQ)
+#if defined(SIOCGIFADDR) && defined(WITH_STRUCT_IFREQ)
 static int
 virNetDevGetIPv4AddressIoctl(const char *ifname,
                              virSocketAddrPtr addr)
@@ -878,7 +878,7 @@ virNetDevGetIPv4AddressIoctl(const char *ifname G_GNUC_UNUSED,
  *
  * Returns 0 on success, -1 on failure, -2 on unsupported.
  */
-#if HAVE_GETIFADDRS
+#if WITH_GETIFADDRS
 static int
 virNetDevGetifaddrsAddress(const char *ifname,
                            virSocketAddrPtr addr)
@@ -925,7 +925,7 @@ virNetDevGetifaddrsAddress(const char *ifname,
     return ret;
 }
 
-#else  /* ! HAVE_GETIFADDRS */
+#else  /* ! WITH_GETIFADDRS */
 
 static int
 virNetDevGetifaddrsAddress(const char *ifname G_GNUC_UNUSED,
index 66d2dafb565552118e69833b994db83238ed759c..143e1ab98cddb910de67a55f00392df8e5de97cc 100644 (file)
@@ -48,7 +48,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode,
 # include <math.h>
 
 /* Older kernels lacked this enum value.  */
-# if !HAVE_DECL_MACVLAN_MODE_PASSTHRU
+# if !WITH_DECL_MACVLAN_MODE_PASSTHRU
 #  define MACVLAN_MODE_PASSTHRU 8
 # endif
 
index f06c6e691e8fed22c9e1ff789131f732af809b49..6c87c7e2ef5325492ca6c87cf9add5fbf5623b30 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef WIN32
 # include <sys/ioctl.h>
 #endif
-#ifdef HAVE_NET_IF_H
+#ifdef WITH_NET_IF_H
 # include <net/if.h>
 #endif
 #include <fcntl.h>
@@ -46,7 +46,7 @@
 # include <net/if_mib.h>
 # include <sys/sysctl.h>
 #endif
-#if defined(HAVE_GETIFADDRS) && defined(AF_LINK)
+#if defined(WITH_GETIFADDRS) && defined(AF_LINK)
 # include <ifaddrs.h>
 #endif
 #include <math.h>
@@ -935,7 +935,7 @@ virNetDevTapInterfaceStats(const char *ifname,
                    _("/proc/net/dev: Interface not found"));
     return -1;
 }
-#elif defined(HAVE_GETIFADDRS) && defined(AF_LINK)
+#elif defined(WITH_GETIFADDRS) && defined(AF_LINK)
 int
 virNetDevTapInterfaceStats(const char *ifname,
                            virDomainInterfaceStatsPtr stats,
index 652ed2c1c69f60ef4bfcfe5111965ab45c06f5d0..be444baa56f0ed3dedb907aa9a4f9ff18412086b 100644 (file)
@@ -40,7 +40,7 @@ VIR_LOG_INIT("util.netlink");
 
 #define NETLINK_ACK_TIMEOUT_S  (2*1000)
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 /* State for a single netlink event handle */
 struct virNetlinkEventHandle {
     int watch;
index e888857601285a41a3aab73e4e71106d5ce79981..40f27524f6732c32e3feef2abe5bea57d0a24877 100644 (file)
@@ -22,7 +22,7 @@
 #include "internal.h"
 #include "virmacaddr.h"
 
-#if defined(__linux__) && defined(HAVE_LIBNL)
+#if defined(__linux__) && defined(WITH_LIBNL)
 
 # include <netlink/msg.h>
 
index 75d5628cff4df8a4ae3224dda990067f905b13ba..ba1e4363d6c000dffed1dd3dff8343aac8a06784 100644 (file)
@@ -53,7 +53,7 @@
 VIR_LOG_INIT("util.numa");
 
 
-#if HAVE_NUMAD
+#if WITH_NUMAD
 char *
 virNumaGetAutoPlacementAdvice(unsigned short vcpus,
                               unsigned long long balloon)
@@ -76,7 +76,7 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus,
 
     return output;
 }
-#else /* !HAVE_NUMAD */
+#else /* !WITH_NUMAD */
 char *
 virNumaGetAutoPlacementAdvice(unsigned short vcpus G_GNUC_UNUSED,
                               unsigned long long balloon G_GNUC_UNUSED)
@@ -85,7 +85,7 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus G_GNUC_UNUSED,
                    _("numad is not available on this host"));
     return NULL;
 }
-#endif /* !HAVE_NUMAD */
+#endif /* !WITH_NUMAD */
 
 #if WITH_NUMACTL
 int
@@ -414,7 +414,7 @@ virNumaGetMaxCPUs(void)
 }
 
 
-#if WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET
+#if WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET
 /**
  * virNumaNodeIsAvailable:
  * @node: node to check
@@ -484,7 +484,7 @@ virNumaGetDistances(int node,
     return 0;
 }
 
-#else /* !(WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET) */
+#else /* !(WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET) */
 
 bool
 virNumaNodeIsAvailable(int node)
@@ -509,7 +509,7 @@ virNumaGetDistances(int node G_GNUC_UNUSED,
     VIR_DEBUG("NUMA distance information isn't available on this host");
     return 0;
 }
-#endif /* !(WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET) */
+#endif /* !(WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET) */
 
 
 /* currently all the huge page stuff below is linux only */
index 90d60c04fb2a96cd66c4070b2732000c6d44f86e..2e95509cafa78ba9f8edc6bf6e6d578408d05696 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef WIN32
 # include <sys/ioctl.h>
 #endif
-#if defined HAVE_SYS_SYSCALL_H
+#if defined WITH_SYS_SYSCALL_H
 # include <sys/syscall.h>
 #endif
 
@@ -67,7 +67,7 @@ struct _virPerf {
     struct virPerfEvent events[VIR_PERF_EVENT_LAST];
 };
 
-#if defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)
+#if defined(__linux__) && defined(WITH_SYS_SYSCALL_H)
 
 # include <linux/perf_event.h>
 
index 044160861aab4e1c5e0ad1eb4a9576353afa2ee9..9de3565051042f00b5d0e7c0ea8dec2f8a4f4b81 100644 (file)
 # include <sys/wait.h>
 #endif
 #include <unistd.h>
-#if HAVE_SYS_MOUNT_H
+#if WITH_SYS_MOUNT_H
 # include <sys/mount.h>
 #endif
-#if HAVE_SETRLIMIT
+#if WITH_SETRLIMIT
 # include <sys/time.h>
 # include <sys/resource.h>
 #endif
-#if HAVE_SCHED_SETSCHEDULER
+#if WITH_SCHED_SETSCHEDULER
 # include <sched.h>
 #endif
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AFFINITY
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || WITH_BSD_CPU_AFFINITY
 # include <sys/param.h>
 #endif
 
@@ -48,7 +48,7 @@
 # include <sys/user.h>
 #endif
 
-#if HAVE_BSD_CPU_AFFINITY
+#if WITH_BSD_CPU_AFFINITY
 # include <sys/cpuset.h>
 #endif
 
@@ -92,7 +92,7 @@ VIR_LOG_INIT("util.process");
 #  endif
 # endif
 
-# ifndef HAVE_SETNS
+# ifndef WITH_SETNS
 #  if defined(__NR_setns)
 #   include <sys/syscall.h>
 
@@ -439,7 +439,7 @@ int virProcessKillPainfully(pid_t pid, bool force)
     return virProcessKillPainfullyDelay(pid, force, 0);
 }
 
-#if HAVE_SCHED_GETAFFINITY
+#if WITH_SCHED_GETAFFINITY
 
 int virProcessSetAffinity(pid_t pid, virBitmapPtr map)
 {
@@ -530,7 +530,7 @@ virProcessGetAffinity(pid_t pid)
     return ret;
 }
 
-#elif defined(HAVE_BSD_CPU_AFFINITY)
+#elif defined(WITH_BSD_CPU_AFFINITY)
 
 int virProcessSetAffinity(pid_t pid,
                           virBitmapPtr map)
@@ -579,7 +579,7 @@ virProcessGetAffinity(pid_t pid)
     return ret;
 }
 
-#else /* HAVE_SCHED_GETAFFINITY */
+#else /* WITH_SCHED_GETAFFINITY */
 
 int virProcessSetAffinity(pid_t pid G_GNUC_UNUSED,
                           virBitmapPtr map G_GNUC_UNUSED)
@@ -596,7 +596,7 @@ virProcessGetAffinity(pid_t pid G_GNUC_UNUSED)
                          _("Process CPU affinity is not supported on this platform"));
     return NULL;
 }
-#endif /* HAVE_SCHED_GETAFFINITY */
+#endif /* WITH_SCHED_GETAFFINITY */
 
 
 int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids)
@@ -708,7 +708,7 @@ int virProcessSetNamespaces(size_t nfdlist,
     return 0;
 }
 
-#if HAVE_PRLIMIT
+#if WITH_PRLIMIT
 static int
 virProcessPrLimit(pid_t pid,
                   int resource,
@@ -717,7 +717,7 @@ virProcessPrLimit(pid_t pid,
 {
     return prlimit(pid, resource, new_limit, old_limit);
 }
-#elif HAVE_SETRLIMIT
+#elif WITH_SETRLIMIT
 static int
 virProcessPrLimit(pid_t pid G_GNUC_UNUSED,
                   int resource G_GNUC_UNUSED,
@@ -729,7 +729,7 @@ virProcessPrLimit(pid_t pid G_GNUC_UNUSED,
 }
 #endif
 
-#if HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK)
+#if WITH_SETRLIMIT && defined(RLIMIT_MEMLOCK)
 int
 virProcessSetMaxMemLock(pid_t pid, unsigned long long bytes)
 {
@@ -769,7 +769,7 @@ virProcessSetMaxMemLock(pid_t pid, unsigned long long bytes)
 
     return 0;
 }
-#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */
+#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */
 int
 virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes)
 {
@@ -779,9 +779,9 @@ virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes)
     virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));
     return -1;
 }
-#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */
+#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */
 
-#if HAVE_GETRLIMIT && defined(RLIMIT_MEMLOCK)
+#if WITH_GETRLIMIT && defined(RLIMIT_MEMLOCK)
 int
 virProcessGetMaxMemLock(pid_t pid,
                         unsigned long long *bytes)
@@ -820,7 +820,7 @@ virProcessGetMaxMemLock(pid_t pid,
 
     return 0;
 }
-#else /* ! (HAVE_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */
+#else /* ! (WITH_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */
 int
 virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED,
                         unsigned long long *bytes)
@@ -831,9 +831,9 @@ virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED,
     virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));
     return -1;
 }
-#endif /* ! (HAVE_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */
+#endif /* ! (WITH_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */
 
-#if HAVE_SETRLIMIT && defined(RLIMIT_NPROC)
+#if WITH_SETRLIMIT && defined(RLIMIT_NPROC)
 int
 virProcessSetMaxProcesses(pid_t pid, unsigned int procs)
 {
@@ -861,7 +861,7 @@ virProcessSetMaxProcesses(pid_t pid, unsigned int procs)
     }
     return 0;
 }
-#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NPROC)) */
+#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_NPROC)) */
 int
 virProcessSetMaxProcesses(pid_t pid G_GNUC_UNUSED, unsigned int procs)
 {
@@ -871,9 +871,9 @@ virProcessSetMaxProcesses(pid_t pid G_GNUC_UNUSED, unsigned int procs)
     virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));
     return -1;
 }
-#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NPROC)) */
+#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_NPROC)) */
 
-#if HAVE_SETRLIMIT && defined(RLIMIT_NOFILE)
+#if WITH_SETRLIMIT && defined(RLIMIT_NOFILE)
 int
 virProcessSetMaxFiles(pid_t pid, unsigned int files)
 {
@@ -909,7 +909,7 @@ virProcessSetMaxFiles(pid_t pid, unsigned int files)
     }
     return 0;
 }
-#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NOFILE)) */
+#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_NOFILE)) */
 int
 virProcessSetMaxFiles(pid_t pid G_GNUC_UNUSED, unsigned int files)
 {
@@ -919,9 +919,9 @@ virProcessSetMaxFiles(pid_t pid G_GNUC_UNUSED, unsigned int files)
     virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));
     return -1;
 }
-#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NOFILE)) */
+#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_NOFILE)) */
 
-#if HAVE_SETRLIMIT && defined(RLIMIT_CORE)
+#if WITH_SETRLIMIT && defined(RLIMIT_CORE)
 int
 virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes)
 {
@@ -946,7 +946,7 @@ virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes)
     }
     return 0;
 }
-#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_CORE)) */
+#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_CORE)) */
 int
 virProcessSetMaxCoreSize(pid_t pid G_GNUC_UNUSED,
                          unsigned long long bytes)
@@ -957,7 +957,7 @@ virProcessSetMaxCoreSize(pid_t pid G_GNUC_UNUSED,
     virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));
     return -1;
 }
-#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_CORE)) */
+#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_CORE)) */
 
 
 #ifdef __linux__
@@ -1419,7 +1419,7 @@ virProcessExitWithStatus(int status)
     exit(value);
 }
 
-#if HAVE_SCHED_SETSCHEDULER
+#if WITH_SCHED_SETSCHEDULER
 
 static int
 virProcessSchedTranslatePolicy(virProcessSchedPolicy policy)
@@ -1515,7 +1515,7 @@ virProcessSetScheduler(pid_t pid,
     return 0;
 }
 
-#else /* ! HAVE_SCHED_SETSCHEDULER */
+#else /* ! WITH_SCHED_SETSCHEDULER */
 
 int
 virProcessSetScheduler(pid_t pid G_GNUC_UNUSED,
@@ -1531,4 +1531,4 @@ virProcessSetScheduler(pid_t pid G_GNUC_UNUSED,
     return -1;
 }
 
-#endif /* !HAVE_SCHED_SETSCHEDULER */
+#endif /* !WITH_SCHED_SETSCHEDULER */
index c31f2ede8fc050cd5c2797a7329cde395749cc7f..de2ef964f4588fa1b64c157c59e4307aed01eaec 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <glib/gprintf.h>
 #include <locale.h>
-#ifdef HAVE_XLOCALE_H
+#ifdef WITH_XLOCALE_H
 # include <xlocale.h>
 #endif
 
@@ -531,7 +531,7 @@ virStrToLong_ullp(char const *s, char **end_ptr, int base,
 }
 
 /* In case thread-safe locales are available */
-#if HAVE_NEWLOCALE
+#if WITH_NEWLOCALE
 
 typedef locale_t virLocale;
 static virLocale virLocaleRaw;
@@ -575,7 +575,7 @@ virLocaleFixupRadix(char **strp G_GNUC_UNUSED)
 {
 }
 
-#else /* !HAVE_NEWLOCALE */
+#else /* !WITH_NEWLOCALE */
 
 typedef int virLocale;
 
@@ -606,7 +606,7 @@ virLocaleFixupRadix(char **strp)
     }
 }
 
-#endif /* !HAVE_NEWLOCALE */
+#endif /* !WITH_NEWLOCALE */
 
 
 /**
index 64013b575cee2fa506fee60cac2017888cde9790..7f23399835749f798bf498cbdf34db93242bc923 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <unistd.h>
 #include <inttypes.h>
-#if HAVE_SYS_SYSCALL_H
+#if WITH_SYS_SYSCALL_H
 # include <sys/syscall.h>
 #endif
 
@@ -297,7 +297,7 @@ bool virThreadIsSelf(virThreadPtr thread)
  * the pthread_self() id on Linux.  */
 unsigned long long virThreadSelfID(void)
 {
-#if defined(HAVE_SYS_SYSCALL_H) && defined(SYS_gettid) && defined(__linux__)
+#if defined(WITH_SYS_SYSCALL_H) && defined(SYS_gettid) && defined(__linux__)
     pid_t tid = syscall(SYS_gettid);
     return tid;
 #else
index dee5a33b9782a7268198263f0b7b00f8fe45523c..48b38c705b38e314dfdcde583b4a34e7d90a2fd6 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <sys/types.h>
 
-#ifdef HAVE_GETPWUID_R
+#ifdef WITH_GETPWUID_R
 # include <pwd.h>
 # include <grp.h>
 #endif
@@ -592,7 +592,7 @@ char *virGetUserRuntimeDirectory(void)
 }
 
 
-#ifdef HAVE_GETPWUID_R
+#ifdef WITH_GETPWUID_R
 /* Look up fields from the user database for the given user.  On
  * error, set errno, report the error if not instructed otherwise via @quiet,
  * and return -1.  */
@@ -1027,7 +1027,7 @@ virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups G_GNUC_UNUSED,
         return -1;
     }
 
-# if HAVE_SETGROUPS
+# if WITH_SETGROUPS
     if (gid != (gid_t)-1 && setgroups(ngroups, groups) < 0) {
         virReportSystemError(errno, "%s",
                              _("cannot set supplemental groups"));
@@ -1045,7 +1045,7 @@ virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups G_GNUC_UNUSED,
     return 0;
 }
 
-#else /* ! HAVE_GETPWUID_R */
+#else /* ! WITH_GETPWUID_R */
 
 int
 virGetGroupList(uid_t uid G_GNUC_UNUSED, gid_t gid G_GNUC_UNUSED,
@@ -1087,7 +1087,7 @@ virGetUserShell(uid_t uid G_GNUC_UNUSED)
     return NULL;
 }
 
-# else /* !HAVE_GETPWUID_R && !WIN32 */
+# else /* !WITH_GETPWUID_R && !WIN32 */
 char *
 virGetUserDirectoryByUID(uid_t uid G_GNUC_UNUSED)
 {
@@ -1105,7 +1105,7 @@ virGetUserShell(uid_t uid G_GNUC_UNUSED)
 
     return NULL;
 }
-# endif /* ! HAVE_GETPWUID_R && ! WIN32 */
+# endif /* ! WITH_GETPWUID_R && ! WIN32 */
 
 char *
 virGetUserName(uid_t uid G_GNUC_UNUSED)
@@ -1154,7 +1154,7 @@ virGetGroupName(gid_t gid G_GNUC_UNUSED)
 
     return NULL;
 }
-#endif /* HAVE_GETPWUID_R */
+#endif /* WITH_GETPWUID_R */
 
 #if WITH_CAPNG
 /* Set the real and effective uid and gid to the given values, while
@@ -1911,19 +1911,19 @@ char *virGetPassword(void)
 static int
 virPipeImpl(int fds[2], bool nonblock, bool errreport)
 {
-#ifdef HAVE_PIPE2
+#ifdef WITH_PIPE2
     int rv;
     int flags = O_CLOEXEC;
     if (nonblock)
         flags |= O_NONBLOCK;
     rv = pipe2(fds, flags);
-#else /* !HAVE_PIPE2 */
+#else /* !WITH_PIPE2 */
 # ifdef WIN32
     int rv = _pipe(fds, 4096, _O_BINARY);
 # else /* !WIN32 */
     int rv = pipe(fds);
 # endif /* !WIN32 */
-#endif /* !HAVE_PIPE2 */
+#endif /* !WITH_PIPE2 */
 
     if (rv < 0) {
         if (errreport)
@@ -1932,7 +1932,7 @@ virPipeImpl(int fds[2], bool nonblock, bool errreport)
         return rv;
     }
 
-#ifndef HAVE_PIPE2
+#ifndef WITH_PIPE2
     if (nonblock) {
         if (virSetNonBlock(fds[0]) < 0 ||
             virSetNonBlock(fds[1]) < 0) {
@@ -1946,7 +1946,7 @@ virPipeImpl(int fds[2], bool nonblock, bool errreport)
             return -1;
         }
     }
-#endif /* !HAVE_PIPE2 */
+#endif /* !WITH_PIPE2 */
 
     return 0;
 }
index f3a2e2b80d96525e812d547131af53542f1310b5..8b0e38e33520505e9ec23fd1e95a25e746c13aaf 100644 (file)
@@ -59,22 +59,22 @@ int virDiskNameToIndex(const char* str);
 char *virIndexToDiskName(int idx, const char *prefix);
 
 /* No-op workarounds for functionality missing in mingw.  */
-#ifndef HAVE_GETUID
+#ifndef WITH_GETUID
 static inline int getuid(void)
 { return 0; }
 #endif
 
-#ifndef HAVE_GETEUID
+#ifndef WITH_GETEUID
 static inline int geteuid(void)
 { return 0; }
 #endif
 
-#ifndef HAVE_GETGID
+#ifndef WITH_GETGID
 static inline int getgid(void)
 { return 0; }
 #endif
 
-#ifndef HAVE_GETEGID
+#ifndef WITH_GETEGID
 static inline int getegid(void)
 { return 0; }
 #endif
index 2638c5095a6fb9786ee75e1820a622db342d7473..4bbbf781672f84920b97b6a3a572bd1d14ef544e 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_SYS_IOCTL_H
+#ifdef WITH_SYS_IOCTL_H
 # include <sys/ioctl.h>
 #endif
 
-#if HAVE_DECL_VHOST_VSOCK_SET_GUEST_CID
+#if WITH_DECL_VHOST_VSOCK_SET_GUEST_CID
 # include <linux/vhost.h>
 #endif
 
@@ -35,7 +35,7 @@
 
 VIR_LOG_INIT("util.vsock");
 
-#if HAVE_DECL_VHOST_VSOCK_SET_GUEST_CID
+#if WITH_DECL_VHOST_VSOCK_SET_GUEST_CID
 static int
 virVsockSetGuestCidQuiet(int fd,
                          unsigned int guest_cid)
index 4a23bd6e624dd528f938414bef1cfa49c65077d1..7a9c87b8cfe9d15763161f9e23404317f555a829 100644 (file)
@@ -23,7 +23,7 @@
 #include <signal.h>
 #include <time.h>
 
-#if HAVE_MACH_CLOCK_ROUTINES
+#if WITH_MACH_CLOCK_ROUTINES
 # include <mach/clock.h>
 # include <mach/mach.h>
 #endif
index a2ef9bed0bca338fc8df36f1b0975822eecbb745..c4d5db9a7b31c9b923be9be3f887a61c9a3e5038 100644 (file)
@@ -180,7 +180,7 @@ mymain(void)
 
     DO_TEST("basic-pv");
     DO_TEST("basic-hvm");
-# ifdef HAVE_XEN_PVH
+# ifdef WITH_XEN_PVH
     DO_TEST("basic-pvh");
 # endif
     DO_TEST("cpu-shares-hvm");
index d7476452ba7f5791ada2970bdffb806f40f2330f..ad13e2de608c235bc4d0ed903f18ebe61c3c30c6 100644 (file)
@@ -474,7 +474,7 @@ if conf.has('WITH_REMOTE')
   ]
 
   nettls_sources = [ 'virnettlshelpers.c' ]
-  if conf.has('HAVE_LIBTASN1_H')
+  if conf.has('WITH_LIBTASN1_H')
     nettls_sources += 'pkix_asn1_tab.c'
   endif
 
index 64d2b757405b54ea669bc1739e48946a25f503de..14355d21662173ffe9b4242935ec853876cbb33c 100644 (file)
@@ -23,7 +23,7 @@
  * detected. */
 
 #include "virmock.h"
-#if HAVE_LINUX_MAGIC_H
+#if WITH_LINUX_MAGIC_H
 # include <linux/magic.h>
 #endif
 #include <selinux/selinux.h>
index 802ee9b5f90befda9ac2dc5bab7ad6826bdaaa9d..7c9174bdd987f90e1fc40d78e80c9f7b559a2728 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include <mntent.h>
 #include <sys/vfs.h>
-#if HAVE_LINUX_MAGIC_H
+#if WITH_LINUX_MAGIC_H
 # include <linux/magic.h>
 #endif
 #include <assert.h>
index 1392536b74a3e4597b6872ab942ef0663b48b114..3c1f2ce54efed5d1025992d2fb588e3c9bdebb74 100644 (file)
@@ -31,7 +31,7 @@
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
-#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R
 static int testFileCheckMounts(const char *prefix,
                                char **gotmounts,
                                size_t gotnmounts,
@@ -91,7 +91,7 @@ static int testFileGetMountSubtree(const void *opaque)
     g_strfreev(gotmounts);
     return ret;
 }
-#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
+#endif /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */
 
 struct testFileSanitizePathData
 {
@@ -122,7 +122,7 @@ testFileSanitizePath(const void *opaque)
 }
 
 
-#if HAVE_DECL_SEEK_HOLE && defined(__linux__)
+#if WITH_DECL_SEEK_HOLE && defined(__linux__)
 
 /* Create a sparse file. @offsets in KiB. */
 static int
@@ -234,7 +234,7 @@ holesSupported(void)
     return ret;
 }
 
-#else /* !HAVE_DECL_SEEK_HOLE || !defined(__linux__)*/
+#else /* !WITH_DECL_SEEK_HOLE || !defined(__linux__)*/
 
 static int
 makeSparseFile(const off_t offsets[] G_GNUC_UNUSED,
@@ -250,7 +250,7 @@ holesSupported(void)
     return false;
 }
 
-#endif /* !HAVE_DECL_SEEK_HOLE || !defined(__linux__)*/
+#endif /* !WITH_DECL_SEEK_HOLE || !defined(__linux__)*/
 
 struct testFileInData {
     bool startData;     /* whether the list of offsets starts with data section */
@@ -356,7 +356,7 @@ mymain(void)
     int ret = 0;
     struct testFileSanitizePathData data1;
 
-#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R
 # define MTAB_PATH1 abs_srcdir "/virfiledata/mounts1.txt"
 # define MTAB_PATH2 abs_srcdir "/virfiledata/mounts2.txt"
 
@@ -386,7 +386,7 @@ mymain(void)
     DO_TEST_MOUNT_SUBTREE("/proc reverse", MTAB_PATH1, "/proc", wantmounts1rev, true);
     DO_TEST_MOUNT_SUBTREE("/etc/aliases", MTAB_PATH2, "/etc/aliases", wantmounts2a, false);
     DO_TEST_MOUNT_SUBTREE("/etc/aliases.db", MTAB_PATH2, "/etc/aliases.db", wantmounts2b, false);
-#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
+#endif /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */
 
 #define DO_TEST_SANITIZE_PATH(PATH, EXPECT) \
     do { \
index 95feeb0d9200f2f8a305e688fed2595496e580b7..a812cfe08b16ffe315772d061d28ad30bdc9883d 100644 (file)
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#if HAVE_DLFCN_H
+#if WITH_DLFCN_H
 # include <dlfcn.h>
 #endif
 
index 2c3715ae0cc8b01010b6b66048da27e7e0f64a4e..1a58025a0a0a3348f1dc578e3ce96429fbec0baa 100644 (file)
 
 
 
-#if defined(HAVE_STAT) && !defined(HAVE___XSTAT) && !defined(HAVE_STAT64)
+#if defined(WITH_STAT) && !defined(WITH___XSTAT) && !defined(WITH_STAT64)
 # define MOCK_STAT
 #endif
-#if defined(HAVE_STAT64) && !defined(HAVE___XSTAT64)
+#if defined(WITH_STAT64) && !defined(WITH___XSTAT64)
 # define MOCK_STAT64
 #endif
-#if defined(HAVE___XSTAT) && !defined(HAVE___XSTAT64)
+#if defined(WITH___XSTAT) && !defined(WITH___XSTAT64)
 # define MOCK___XSTAT
 #endif
-#if defined(HAVE___XSTAT64)
+#if defined(WITH___XSTAT64)
 # define MOCK___XSTAT64
 #endif
-#if defined(HAVE_LSTAT) && !defined(HAVE___LXSTAT) && !defined(HAVE_LSTAT64)
+#if defined(WITH_LSTAT) && !defined(WITH___LXSTAT) && !defined(WITH_LSTAT64)
 # define MOCK_LSTAT
 #endif
-#if defined(HAVE_LSTAT64) && !defined(HAVE___LXSTAT64)
+#if defined(WITH_LSTAT64) && !defined(WITH___LXSTAT64)
 # define MOCK_LSTAT64
 #endif
-#if defined(HAVE___LXSTAT) && !defined(HAVE___LXSTAT64)
+#if defined(WITH___LXSTAT) && !defined(WITH___LXSTAT64)
 # define MOCK___LXSTAT
 #endif
-#if defined(HAVE___LXSTAT64)
+#if defined(WITH___LXSTAT64)
 # define MOCK___LXSTAT64
 #endif
 
index 7d2ad36aae31932a0a3cb7fb57c729f898680dd5..b8baca0c23b06889c8a2ae94d6c83ca7d6430991 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <signal.h>
 #include <unistd.h>
-#ifdef HAVE_IFADDRS_H
+#ifdef WITH_IFADDRS_H
 # include <ifaddrs.h>
 #endif
 
@@ -37,7 +37,7 @@
 
 VIR_LOG_INIT("tests.netsockettest");
 
-#if HAVE_IFADDRS_H
+#if WITH_IFADDRS_H
 # define BASE_PORT 5672
 
 static int
@@ -522,7 +522,7 @@ static int
 mymain(void)
 {
     int ret = 0;
-#ifdef HAVE_IFADDRS_H
+#ifdef WITH_IFADDRS_H
     bool hasIPv4, hasIPv6;
     int freePort;
 #endif
@@ -533,7 +533,7 @@ mymain(void)
 
     virEventRegisterDefaultImpl();
 
-#ifdef HAVE_IFADDRS_H
+#ifdef WITH_IFADDRS_H
     if (checkProtocols(&hasIPv4, &hasIPv6, &freePort) < 0) {
         fprintf(stderr, "Cannot identify IPv4/6 availability\n");
         return EXIT_FAILURE;
index 9860e0ec3e7f0d154451d1fde2e007bb815270b3..26793545c1a809dce840e04323d0df46971e9a5b 100644 (file)
@@ -30,7 +30,7 @@
 #include "vircommand.h"
 #include "virsocket.h"
 
-#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
+#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
 # include "rpc/virnettlscontext.h"
 
index 979afed307e407eb2a4c5a1557baa2e6204e1e24..e0a47718941df4828a1e99942b5f6b674bddbb7a 100644 (file)
@@ -27,7 +27,7 @@
 #include "virsocketaddr.h"
 #include "virutil.h"
 
-#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
+#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
 # define VIR_FROM_THIS VIR_FROM_RPC
 
index 4c6f5e8c3139e80d6844a633a637aa9e54e2ba65..cdc92a17f863cedc83389a32030576a1ecba06c4 100644 (file)
@@ -21,7 +21,7 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 
-#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
+#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
 # include <libtasn1.h>
 
index ebb90ad5a2f4be1356eeb54418360501645acdeb..ccb5cad19886339d97be79420c7f8f18ebf4f4a6 100644 (file)
@@ -30,7 +30,7 @@
 #include "vircommand.h"
 #include "virsocket.h"
 
-#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
+#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
 # define VIR_FROM_THIS VIR_FROM_RPC
 
index 28fe89200e0b56f8f92a299d273dd1263ce9a1ca..964f4759449184ebb6528e3f0f1d2362478781a6 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <config.h>
 
-#if HAVE_DLFCN_H
+#if WITH_DLFCN_H
 # include <dlfcn.h>
 #endif
 
index 0a938f6410f71f96bb32c872d73fab707842b514..691d3f22f1bb3bfe5b2762580302f7d428c3193c 100644 (file)
@@ -20,7 +20,7 @@
 #include "virfile.h"
 #include "testutils.h"
 
-#if HAVE_DLFCN_H
+#if WITH_DLFCN_H
 # include <dlfcn.h>
 #endif
 
index 179ae5e5e73d984f9245fa7bb4fb5c191eda3737..e0f8b6d6210cd4aa3f2f0fd61d8b2c18310b1b44 100644 (file)
@@ -198,7 +198,7 @@ testPrepImages(void)
     if (virCommandRun(cmd, NULL) < 0)
         goto skip;
 
-#ifdef HAVE_SYMLINK
+#ifdef WITH_SYMLINK
     /* Create some symlinks in a sub-directory. */
     if (symlink("../qcow2", datadir "/sub/link1") < 0 ||
         symlink("../wrap", datadir "/sub/link2") < 0) {
@@ -859,7 +859,7 @@ mymain(void)
     TEST_CHAIN(absdir, VIR_STORAGE_FILE_NONE, (&dir), EXP_PASS);
     TEST_CHAIN(absdir, VIR_STORAGE_FILE_DIR, (&dir), EXP_PASS);
 
-#ifdef HAVE_SYMLINK
+#ifdef WITH_SYMLINK
     /* Rewrite qcow2 and wrap file to use backing names relative to a
      * symlink from a different directory */
     virCommandFree(cmd);
index 15369d8eb2a51890e4ab7734e29fee5163218b23..7e5ac01c6ca4c444989a7fb68cb41ce7c2b244e8 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 #include <locale.h>
-#ifdef HAVE_XLOCALE_H
+#ifdef WITH_XLOCALE_H
 # include <xlocale.h>
 #endif
 #include <wchar.h>
index 6331c65131345af1bc1b02567cd4426ac1120541..b021efc3c9b037aaa7414b94828d68896f6744c1 100644 (file)
@@ -356,7 +356,7 @@ NSS_NAME(gethostbyname3)(const char *name, int af, struct hostent *result,
     return ret;
 }
 
-#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE
+#ifdef WITH_STRUCT_GAIH_ADDRTUPLE
 enum nss_status
 NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
                          char *buffer, size_t buflen, int *errnop,
@@ -449,7 +449,7 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
     free(addr);
     return ret;
 }
-#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
+#endif /* WITH_STRUCT_GAIH_ADDRTUPLE */
 
 #if defined(WITH_BSD_NSS)
 NSS_METHOD_PROTOTYPE(_nss_compat_getaddrinfo);
index 121b9e87227d1c69a538960a742dde30960ed077..2bb313f329f0874610b935dbb43c3965a9484d58 100644 (file)
@@ -77,12 +77,12 @@ NSS_NAME(gethostbyname3)(const char *name, int af, struct hostent *result,
                          char *buffer, size_t buflen, int *errnop,
                          int *herrnop, int32_t *ttlp, char **canonp);
 
-#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE
+#ifdef WITH_STRUCT_GAIH_ADDRTUPLE
 enum nss_status
 NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
                          char *buffer, size_t buflen, int *errnop,
                          int *herrnop, int32_t *ttlp);
-#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
+#endif /* WITH_STRUCT_GAIH_ADDRTUPLE */
 
 #if defined(WITH_BSD_NSS)
 ns_mtab*
index e797e63475d7021f7e25b0f73da2bf3c8f1d177d..c119d649ce3b8ad42a902c779214d3dc87506053 100644 (file)
@@ -21,9 +21,9 @@
 
 #include <config.h>
 
-#ifdef HAVE_LIBINTL_H
+#ifdef WITH_LIBINTL_H
 # include <libintl.h>
-#endif /* HAVE_LIBINTL_H */
+#endif /* WITH_LIBINTL_H */
 #include <getopt.h>
 
 #include "internal.h"