libnbd 0.1.5 was released today, but is not yet packaged for
Fedora. I'd prefer to bump the minimum version in the pkg-config check
in configure.ac, as such, I won't be pushing this patch as-is, but
waiting until Fedora does have the newer build. But anyone playing
with a self-built libnbd library in the meantime needs this patch to
deal with the ABI change.
---
plugins/nbd/nbd.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index 68ea3dd0..818f94d6 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -783,9 +783,18 @@ nbdplug_flush (void *handle, uint32_t flags)
return nbdplug_reply (h, s);
}
+/* XXX: Hack this signature to compile to 0.1.3 (minimum configure
+ * version) as well as 0.1.5 (API change, with witness of the addition
+ * of pread_structured at the same release). Once configure requires a
+ * higher minimum version, the #if hack can be dropped.
+ */
static int
nbdplug_extent (void *opaque, const char *metacontext, uint64_t offset,
- uint32_t *entries, size_t nr_entries)
+ uint32_t *entries, size_t nr_entries
+#if LIBNBD_HAVE_NBD_PREAD_STRUCTURED
+ , int *error
+#endif
+ )
{
struct nbdkit_extents *extents = opaque;
--
2.20.1