[Libguestfs] [PATCH common] options: Require libguestfs >= 1.42.

Richard W.M. Jones rjones at redhat.com
Tue Mar 10 13:07:56 UTC 2020


Libguestfs itself is obviously now >= 1.42.  In virt-v2v we made a
similar change upstream to require libguestfs >= 1.42.  Therefore the
ifdefs are no longer required.
---
 options/decrypt.c | 5 -----
 options/options.c | 4 ----
 2 files changed, 9 deletions(-)

diff --git a/options/decrypt.c b/options/decrypt.c
index 683cf5ed4..32ef29fd6 100644
--- a/options/decrypt.c
+++ b/options/decrypt.c
@@ -85,12 +85,7 @@ inspect_do_decrypt (guestfs_h *g, struct key_store *ks)
     if (type && STREQ (type, "crypto_LUKS")) {
       char mapname[32];
       make_mapname (partitions[i], mapname, sizeof mapname);
-
-#ifdef GUESTFS_HAVE_LUKS_UUID
       CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]);
-#else
-      const char *uuid = NULL;
-#endif
 
       CLEANUP_FREE_STRING_LIST char **keys = get_keys (ks, partitions[i], uuid);
       assert (guestfs_int_count_strings (keys) > 0);
diff --git a/options/options.c b/options/options.c
index abdcbae5b..63221ea32 100644
--- a/options/options.c
+++ b/options/options.c
@@ -140,12 +140,10 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
         ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
         ad_optargs.discard = drv->a.discard;
       }
-#ifdef GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK
       if (drv->a.blocksize) {
         ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
         ad_optargs.blocksize = drv->a.blocksize;
       }
-#endif
 
       r = guestfs_add_drive_opts_argv (g, drv->a.filename, &ad_optargs);
       if (r == -1)
@@ -179,12 +177,10 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
         ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_SECRET_BITMASK;
         ad_optargs.secret = drv->uri.password;
       }
-#ifdef GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK
       if (drv->uri.blocksize) {
         ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
         ad_optargs.blocksize = drv->uri.blocksize;
       }
-#endif
 
       r = guestfs_add_drive_opts_argv (g, drv->uri.path, &ad_optargs);
       if (r == -1)
-- 
2.25.0




More information about the Libguestfs mailing list