[Libguestfs] [nbdkit PATCH 2/2] nbd: Another libnbd API bump

Eric Blake eblake at redhat.com
Wed Jul 17 02:43:39 UTC 2019


libnbd 0.1.8 is due out soon, which reorders several function
arguments.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 configure.ac      |  4 ++--
 plugins/nbd/nbd.c | 17 +++++++++--------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3b355667..77f08f46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -718,12 +718,12 @@ AC_ARG_WITH([libnbd],
     [],
     [with_libnbd=check])
 AS_IF([test "$with_libnbd" != "no"],[
-    PKG_CHECK_MODULES([LIBNBD], [libnbd >= 0.1.7],[
+    PKG_CHECK_MODULES([LIBNBD], [libnbd >= 0.1.8],[
         AC_SUBST([LIBNBD_CFLAGS])
         AC_SUBST([LIBNBD_LIBS])
         AC_DEFINE([HAVE_LIBNBD],[1],[libnbd found at compile time.])
     ],
-    [AC_MSG_WARN([libnbd >= 0.1.7 not found, nbd plugin will be crippled])])
+    [AC_MSG_WARN([libnbd >= 0.1.8 not found, nbd plugin will be crippled])])
 ])
 AM_CONDITIONAL([HAVE_LIBNBD], [test "x$LIBNBD_LIBS" != "x"])

diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index 48873d09..83a30583 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -673,7 +673,7 @@ nbdplug_pread (void *handle, void *buf, uint32_t count, uint64_t offset,
   assert (!flags);
   nbdplug_prepare (&s);
   nbdplug_register (h, &s, nbd_aio_pread_callback (h->nbd, buf, count, offset,
-                                                   &s, nbdplug_notify, 0));
+                                                   nbdplug_notify, &s, 0));
   return nbdplug_reply (h, &s);
 }

@@ -689,7 +689,7 @@ nbdplug_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset,
   assert (!(flags & ~NBDKIT_FLAG_FUA));
   nbdplug_prepare (&s);
   nbdplug_register (h, &s, nbd_aio_pwrite_callback (h->nbd, buf, count, offset,
-                                                    &s, nbdplug_notify, f));
+                                                    nbdplug_notify, &s, f));
   return nbdplug_reply (h, &s);
 }

@@ -709,7 +709,7 @@ nbdplug_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
     f |= LIBNBD_CMD_FLAG_FUA;
   nbdplug_prepare (&s);
   nbdplug_register (h, &s, nbd_aio_zero_callback (h->nbd, count, offset,
-                                                  &s, nbdplug_notify, f));
+                                                  nbdplug_notify, &s, f));
   return nbdplug_reply (h, &s);
 }

@@ -724,7 +724,7 @@ nbdplug_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
   assert (!(flags & ~NBDKIT_FLAG_FUA));
   nbdplug_prepare (&s);
   nbdplug_register (h, &s, nbd_aio_trim_callback (h->nbd, count, offset,
-                                                  &s, nbdplug_notify, f));
+                                                  nbdplug_notify, &s, f));
   return nbdplug_reply (h, &s);
 }

@@ -738,7 +738,7 @@ nbdplug_flush (void *handle, uint32_t flags)
   assert (!flags);
   nbdplug_prepare (&s);
   nbdplug_register (h, &s, nbd_aio_flush_callback (h->nbd,
-                                                   &s, nbdplug_notify, 0));
+                                                   nbdplug_notify, &s, 0));
   return nbdplug_reply (h, &s);
 }

@@ -777,8 +777,9 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset,
   nbdplug_prepare (&s);
   s.extents = extents;
   nbdplug_register (h, &s, nbd_aio_block_status_callback (h->nbd, count, offset,
-                                                          &s, nbdplug_extent,
-                                                          nbdplug_notify, f));
+                                                          nbdplug_extent,
+                                                          nbdplug_notify, &s,
+                                                          f));
   return nbdplug_reply (h, &s);
 }

@@ -792,7 +793,7 @@ nbdplug_cache (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
   assert (!flags);
   nbdplug_prepare (&s);
   nbdplug_register (h, &s, nbd_aio_cache_callback (h->nbd, count, offset,
-                                                   &s, nbdplug_notify, 0));
+                                                   nbdplug_notify, &s, 0));
   return nbdplug_reply (h, &s);
 }

-- 
2.20.1




More information about the Libguestfs mailing list