Skip to content
Permalink
Browse files

lib: enable the libvirt code consistently everywhere

With commit bc2b417
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.
  • Loading branch information...
ptoscano committed Nov 9, 2015
1 parent cbeb127 commit 3b54869dad77283834a9be4779a6a9187d39765d
Showing with 3 additions and 4 deletions.
  1. +3 −4 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"

0 comments on commit 3b54869

Please sign in to comment.
You can’t perform that action at this time.