libnbd 0.1.7 was released today, which breaks compilation of nbdkit-nbd-plugin. We could work around it by using #ifdef LIBNBD_HAVE_XXX to learn about the renamed functions, but supporting older versions is not all that important when we don't yet have API stability. So patch 1 copes by just bumping the minimum version instead, except that we have yet another pending libnbd patch with an API break - and those changes are trickier (reordering parameters does NOT create a new LIBNBD_HAVE_XXX witness macro, so you can't easily compile for 0.1.7 and 0.1.8 at the same time), so I'm leaning more towards doing nothing until libnbd 0.1.8 is released and then squashing these together (as that shouldn't be much longer). If short-term compilation is needed without these patches, change PKG_CHECK_MODULES to request [libnbd = 0.1.6] instead of >= (to gracefully fall back to non-libnbd compilation if you don't have libnbd 0.1.6 around). Eric Blake (2): nbd: Another libnbd API bump nbd: Another libnbd API bump configure.ac | 4 ++-- plugins/nbd/nbd.c | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) -- 2.20.1
Eric Blake
2019-Jul-17 02:43 UTC
[Libguestfs] [nbdkit PATCH 1/2] nbd: Another libnbd API bump
libnbd 0.1.7 is now out, which renamed several functions. Signed-off-by: Eric Blake <eblake@redhat.com> --- configure.ac | 4 ++-- plugins/nbd/nbd.c | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 1adbe675..3b355667 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.6],[ + PKG_CHECK_MODULES([LIBNBD], [libnbd >= 0.1.7],[ AC_SUBST([LIBNBD_CFLAGS]) AC_SUBST([LIBNBD_LIBS]) AC_DEFINE([HAVE_LIBNBD],[1],[libnbd found at compile time.]) ], - [AC_MSG_WARN([libnbd >= 0.1.6 not found, nbd plugin will be crippled])]) + [AC_MSG_WARN([libnbd >= 0.1.7 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 548839cf..48873d09 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -672,8 +672,8 @@ nbdplug_pread (void *handle, void *buf, uint32_t count, uint64_t offset, assert (!flags); nbdplug_prepare (&s); - nbdplug_register (h, &s, nbd_aio_pread_notify (h->nbd, buf, count, offset, - &s, nbdplug_notify, 0)); + nbdplug_register (h, &s, nbd_aio_pread_callback (h->nbd, buf, count, offset, + &s, nbdplug_notify, 0)); return nbdplug_reply (h, &s); } @@ -688,8 +688,8 @@ 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_notify (h->nbd, buf, count, offset, - &s, nbdplug_notify, f)); + nbdplug_register (h, &s, nbd_aio_pwrite_callback (h->nbd, buf, count, offset, + &s, nbdplug_notify, f)); return nbdplug_reply (h, &s); } @@ -708,8 +708,8 @@ nbdplug_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) if (flags & NBDKIT_FLAG_FUA) f |= LIBNBD_CMD_FLAG_FUA; nbdplug_prepare (&s); - nbdplug_register (h, &s, nbd_aio_zero_notify (h->nbd, count, offset, - &s, nbdplug_notify, f)); + nbdplug_register (h, &s, nbd_aio_zero_callback (h->nbd, count, offset, + &s, nbdplug_notify, f)); return nbdplug_reply (h, &s); } @@ -723,8 +723,8 @@ 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_notify (h->nbd, count, offset, - &s, nbdplug_notify, f)); + nbdplug_register (h, &s, nbd_aio_trim_callback (h->nbd, count, offset, + &s, nbdplug_notify, f)); return nbdplug_reply (h, &s); } @@ -737,8 +737,8 @@ nbdplug_flush (void *handle, uint32_t flags) assert (!flags); nbdplug_prepare (&s); - nbdplug_register (h, &s, nbd_aio_flush_notify (h->nbd, - &s, nbdplug_notify, 0)); + nbdplug_register (h, &s, nbd_aio_flush_callback (h->nbd, + &s, nbdplug_notify, 0)); return nbdplug_reply (h, &s); } @@ -776,9 +776,9 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset, assert (!(flags & ~NBDKIT_FLAG_REQ_ONE)); nbdplug_prepare (&s); s.extents = extents; - nbdplug_register (h, &s, nbd_aio_block_status_notify (h->nbd, count, offset, - &s, nbdplug_extent, - nbdplug_notify, f)); + nbdplug_register (h, &s, nbd_aio_block_status_callback (h->nbd, count, offset, + &s, nbdplug_extent, + nbdplug_notify, f)); return nbdplug_reply (h, &s); } @@ -791,8 +791,8 @@ 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_notify (h->nbd, count, offset, - &s, nbdplug_notify, 0)); + nbdplug_register (h, &s, nbd_aio_cache_callback (h->nbd, count, offset, + &s, nbdplug_notify, 0)); return nbdplug_reply (h, &s); } -- 2.20.1
Eric Blake
2019-Jul-17 02:43 UTC
[Libguestfs] [nbdkit PATCH 2/2] nbd: Another libnbd API bump
libnbd 0.1.8 is due out soon, which reorders several function arguments. Signed-off-by: Eric Blake <eblake@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
Richard W.M. Jones
2019-Jul-17 09:58 UTC
Re: [Libguestfs] [nbdkit PATCH 2/2] nbd: Another libnbd API bump
I guess you might as well push this. I'll have a libnbd 0.1.8 release out pretty soon. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html