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

[Libguestfs] [PATCH 1/2] lib: enable the libvirt code consistently everywhere



With commit bc2b41778405cc6a376a670703ce63e3678bf1fb
HAVE_LIBVIRT_BACKEND is defined based on the libvirt version (using its
version macro), although libvirt.h is included only after that check:
because of this, variables in the guestfs_h struct after the
HAVE_LIBVIRT_BACKEND block would be used wrongly if libvirt.h was not
included before guestfs-internal.h, like in the recently added
available.c (all the other places using libvirt features in the handle
already happened to do so).

Considering guestfs-internal.h already includes libvirt.h, move its
inclusion up, right before the libvirt version check.
---
 src/guestfs-internal.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index bc03ccc..a9f2f0d 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -38,12 +38,11 @@
                              MIN_LIBVIRT_MINOR * 1000 +		\
                              MIN_LIBVIRT_MICRO)
 
-#if defined(HAVE_LIBVIRT) && LIBVIR_VERSION_NUMBER >= MIN_LIBVIRT_VERSION
-#define HAVE_LIBVIRT_BACKEND
-#endif
-
 #ifdef HAVE_LIBVIRT
 #include <libvirt/libvirt.h>
+#if LIBVIR_VERSION_NUMBER >= MIN_LIBVIRT_VERSION
+#define HAVE_LIBVIRT_BACKEND
+#endif
 #endif
 
 #include "hash.h"
-- 
2.1.0


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