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
Richard W.M. Jones
2019-Jun-28 08:09 UTC
Re: [Libguestfs] [nbdkit PATCH] nbd: Update for libnbd 0.1.5
On Thu, Jun 27, 2019 at 04:06:21PM -0500, Eric Blake wrote:> 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.The new build is in Fedora already, but for F29/F30 is still waiting in the queue: https://bodhi.fedoraproject.org/updates/FEDORA-2019-c301e5692c https://bodhi.fedoraproject.org/updates/FEDORA-2019-83f9a5e552 I wouldn't bother with hacks to deal with both APIs, just bump the minimum required version. Rich.> 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 > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Seemingly Similar Threads
- [nbdkit PATCH 0/2] Use new libnbd _notify functions
- [nbdkit PATCH] nbd: Another libnbd version bump
- [libnbd PATCH] block-status: Make callback usage consistent with pread_structured
- [nbdkit PATCH 0/2] Another libnbd API bump
- [nbdkit PATCH 2/2] nbd: Another libnbd API bump