mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
df: Avoid a compilation error if libxml2 is not available.
virt_df-domains.o: In function `add_domain': /home/feeliwood/Downloads/libguestfs-1.17.21/df/domains.c:274: undefined reference to `guestfs___for_each_disk' guestfs___for_each_disk is only available when libvirt _and_ libxml2 dependencies are available at compile time. Thanks Tho Huynh.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
#include "options.h"
|
||||
#include "virt-df.h"
|
||||
|
||||
#ifdef HAVE_LIBVIRT
|
||||
#if defined(HAVE_LIBVIRT) && defined(HAVE_LIBXML2)
|
||||
|
||||
/* Limit the number of devices we will ever add to the appliance. The
|
||||
* overall limit in current libguestfs is 25: 26 = number of letters
|
||||
|
||||
@@ -260,10 +260,10 @@ main (int argc, char *argv[])
|
||||
* the full list of guests and drives, which we add in batches.
|
||||
*/
|
||||
if (drvs == NULL) {
|
||||
#ifdef HAVE_LIBVIRT
|
||||
#if defined(HAVE_LIBVIRT) && defined(HAVE_LIBXML2)
|
||||
get_domains_from_libvirt ();
|
||||
#else
|
||||
fprintf (stderr, _("%s: compiled without support for libvirt.\n"),
|
||||
fprintf (stderr, _("%s: compiled without support for libvirt and/or libxml2.\n"),
|
||||
program_name);
|
||||
exit (EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,7 @@ extern int uuid; /* --uuid */
|
||||
extern int df_on_handle (const char *name, const char *uuid, char **devices, int offset);
|
||||
|
||||
/* domains.c */
|
||||
#ifdef HAVE_LIBVIRT
|
||||
#if defined(HAVE_LIBVIRT) && defined(HAVE_LIBXML2)
|
||||
extern void get_domains_from_libvirt (void);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user