On Mon, Aug 26, 2019 at 12:15:27PM -0500, Eric Blake wrote:
We do not promise API compatibility for filters between stable
releases of nbdkit, however, we should at least ensure that when we do
break API, that we refuse to load a filter compiled against one
version of nbdkit with another server running a different API. A
single bump once per stable release is good enough (rather than once
per API change).
We did this correctly for commits b0ce4411/cb309687/df0cc21d (bumping
to API version 2 for the combined changes between v1.2 and v1.4), but
failed to do so for f184fdc3 (affecting v1.10), 4ca66f70 (affecting
v1.12), or 5ee7bd29/ee61d232 (affecting the upcoming v1.14). So do it
retroacively now, as well as backporting intermediate bumps to
affected stable branches.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
I'm pushing this soon.
include/nbdkit-filter.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/nbdkit-filter.h b/include/nbdkit-filter.h
index 94f17789..1ebd1cb6 100644
--- a/include/nbdkit-filter.h
+++ b/include/nbdkit-filter.h
@@ -43,7 +43,7 @@
extern "C" {
#endif
-#define NBDKIT_FILTER_API_VERSION 2
+#define NBDKIT_FILTER_API_VERSION 5
struct nbdkit_extent {
uint64_t offset;
@@ -100,8 +100,10 @@ struct nbdkit_filter {
*/
int _api_version;
- /* Because there is no ABI guarantee, new fields may be added
- * where logically appropriate. */
+ /* Because there is no ABI guarantee, new fields may be added where
+ * logically appropriate, as long as we correctly bump
+ * NBDKIT_FILTER_API_VERSION once per stable release.
+ */
const char *name;
const char *longname;
const char *version;
ACK, although maybe we should just check the version strings are equal ...
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/