Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package nbdkit for openSUSE:Factory checked in at 2025-11-05 16:18:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nbdkit (Old) and /work/SRC/openSUSE:Factory/.nbdkit.new.1980 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nbdkit" Wed Nov 5 16:18:45 2025 rev:24 rq:1315532 version:1.44.4 Changes: -------- --- /work/SRC/openSUSE:Factory/nbdkit/nbdkit.changes 2025-09-14 18:50:50.563774212 +0200 +++ /work/SRC/openSUSE:Factory/.nbdkit.new.1980/nbdkit.changes 2025-11-05 16:22:00.439417056 +0100 @@ -1,0 +2,25 @@ +Tue Oct 28 16:12:09 UTC 2025 - Charles Arnold <[email protected]> + +- Update to version 1.44.4: + * Version 1.44.4. + * linuxdisk: Fix parsing of last line of 'du' command output + * ocaml: Don't unregister the thread in close_wrapper + * tests/test-ocaml-errorcodes: Check recovery after reading an error + * tests/test_ocaml_errorcodes_plugin.ml: Call Gc.compact on unload + * configure: Use PRINT_PKG_VERSION macro in more places + * configure: Add new macro to print package version + * vddk: Don't use FNM_PATHNAME when matching export parameter + * ocaml: Don't release OCaml runtime system after caml_shutdown + * data: Avoid passing signed int64_t to uint64_t vararg parameter + * data: Fix comment about how uint8_t is promoted through varargs + * build: Check for qemu-img and disable some tests if not present + * tests/curl: Skip test if 'disk' was not created + * server/public.c: Use common/include parse_bool function + * common/include: Extra bool parsing into a mini-library + * docs: Shorter title and tweaks to the description + * vddk: Sort synopsis into alphabetical order + * ext2: Update docs since filter supports concurrent connections + * docs/nbdkit-probing.pod: Rearrange synopsis to match description + * docs: Fix bolding of --log=/path option + +------------------------------------------------------------------- Old: ---- nbdkit-1.44.3.tar.xz New: ---- nbdkit-1.44.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nbdkit.spec ++++++ --- /var/tmp/diff_new_pack.lhSKF5/_old 2025-11-05 16:22:01.291452872 +0100 +++ /var/tmp/diff_new_pack.lhSKF5/_new 2025-11-05 16:22:01.303453376 +0100 @@ -1,7 +1,7 @@ # # spec file for package nbdkit # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,7 +27,7 @@ %global broken_test_arches %{arm} aarch64 %{ix86} Name: nbdkit -Version: 1.44.3 +Version: 1.44.4 Release: 0 Summary: Network Block Device server License: BSD-3-Clause @@ -179,9 +179,9 @@ + # The plugins below have non-trivial dependencies are so are # packaged separately. - %package cdi-plugin Summary: Containerized Data Import plugin for %{name} Requires: %{name}-server = %{version}-%{release} @@ -206,9 +206,9 @@ + # In theory this is noarch, but because plugins are placed in _libdir # which varies across architectures, RPM does not allow this. - %package gcs-plugin Summary: Gooogle Cloud Storage plugin %{name} Requires: %{name}-python-plugin = %{version}-%{release} ++++++ _service ++++++ --- /var/tmp/diff_new_pack.lhSKF5/_old 2025-11-05 16:22:01.347455226 +0100 +++ /var/tmp/diff_new_pack.lhSKF5/_new 2025-11-05 16:22:01.351455394 +0100 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="manual"> <param name="filename">nbdkit</param> - <param name="revision">v1.44.3</param> + <param name="revision">v1.44.4</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://gitlab.com/nbdkit/nbdkit.git</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.lhSKF5/_old 2025-11-05 16:22:01.379456571 +0100 +++ /var/tmp/diff_new_pack.lhSKF5/_new 2025-11-05 16:22:01.379456571 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://gitlab.com/nbdkit/nbdkit.git</param> - <param name="changesrevision">aaa47f1ff93ec90133669f5721ff804fe00f1792</param></service></servicedata> + <param name="changesrevision">30ee9518a24f63ed5f66d0b30ac2544dc9da18a5</param></service></servicedata> (No newline at EOF) ++++++ nbdkit-1.44.3.tar.xz -> nbdkit-1.44.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/common/include/Makefile.am new/nbdkit-1.44.4/common/include/Makefile.am --- old/nbdkit-1.44.3/common/include/Makefile.am 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/common/include/Makefile.am 2025-10-27 12:43:44.000000000 +0100 @@ -50,6 +50,7 @@ minmax.h \ nextnonzero.h \ once.h \ + parse-bool.h \ random.h \ rounding.h \ static-assert.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/common/include/parse-bool.h new/nbdkit-1.44.4/common/include/parse-bool.h --- old/nbdkit-1.44.3/common/include/parse-bool.h 1970-01-01 01:00:00.000000000 +0100 +++ new/nbdkit-1.44.4/common/include/parse-bool.h 2025-10-27 12:43:44.000000000 +0100 @@ -0,0 +1,66 @@ +/* nbdkit + * Copyright Red Hat + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Red Hat nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef NBDKIT_PARSE_BOOL_H +#define NBDKIT_PARSE_BOOL_H + +#include <string.h> +#include "ascii-string.h" + +/* Parse a boolean-like string. Returns: + * 1 => string is true + * 0 => string is false + * -1 => string could not be parsed as a boolean + */ +static inline int +parse_bool (const char *str) +{ + if (!strcmp (str, "1") || + !ascii_strcasecmp (str, "true") || + !ascii_strcasecmp (str, "t") || + !ascii_strcasecmp (str, "yes") || + !ascii_strcasecmp (str, "y") || + !ascii_strcasecmp (str, "on")) + return 1; + + if (!strcmp (str, "0") || + !ascii_strcasecmp (str, "false") || + !ascii_strcasecmp (str, "f") || + !ascii_strcasecmp (str, "no") || + !ascii_strcasecmp (str, "n") || + !ascii_strcasecmp (str, "off")) + return 0; + + return -1; +} + +#endif /* NBDKIT_PARSE_BOOL_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/configure.ac new/nbdkit-1.44.4/configure.ac --- old/nbdkit-1.44.3/configure.ac 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/configure.ac 2025-10-27 12:43:44.000000000 +0100 @@ -31,7 +31,7 @@ m4_define([NBDKIT_VERSION_MAJOR], [1]) m4_define([NBDKIT_VERSION_MINOR], [44]) -m4_define([NBDKIT_VERSION_MICRO], [3]) +m4_define([NBDKIT_VERSION_MICRO], [4]) AC_INIT([nbdkit], NBDKIT_VERSION_MAJOR.NBDKIT_VERSION_MINOR.NBDKIT_VERSION_MICRO) AC_CONFIG_MACRO_DIR([m4]) @@ -757,11 +757,15 @@ HEADING([Checking for libraries and programs]) +m4_define([PRINT_PKG_VERSION], + [AS_ECHO_N(["$1 version is "]); $PKG_CONFIG --modversion "$1"]) + dnl Check for SELinux socket labelling (optional). AC_ARG_WITH([selinux], AS_HELP_STRING([--without-selinux], [disable SELinux support, used for socket labelling @<:@default=check@:>@])) AS_IF([test "x$with_selinux" != xno], [ PKG_CHECK_MODULES([LIBSELINUX], [libselinux], [ + PRINT_PKG_VERSION(libselinux) AC_SUBST([LIBSELINUX_CFLAGS]) AC_SUBST([LIBSELINUX_LIBS]) AC_DEFINE([HAVE_LIBSELINUX],[1],[libselinux found at compile time.]) @@ -785,6 +789,7 @@ [enable_valgrind=check]) AS_IF([test "x$enable_valgrind" != "xno"],[ PKG_CHECK_MODULES([VALGRIND], [valgrind], [ + PRINT_PKG_VERSION(valgrind) AC_SUBST([VALGRIND_CFLAGS]) AC_SUBST([VALGRIND_LIBS]) AC_DEFINE([HAVE_VALGRIND],[1],[Valgrind headers found at compile time]) @@ -801,6 +806,7 @@ AS_IF([test "x$with_gnutls" != xno], [ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.5.18], [ + PRINT_PKG_VERSION(gnutls) AC_SUBST([GNUTLS_CFLAGS]) AC_SUBST([GNUTLS_LIBS]) AC_DEFINE([HAVE_GNUTLS],[1],[gnutls found at compile time.]) @@ -881,6 +887,12 @@ AC_CHECK_PROGS([STAT],[gstat stat],[stat]) AC_CHECK_PROGS([TRUNCATE],[gtruncate truncate],[truncate]) +dnl qemu-img is used by the tests to create the disk. This might not +dnl be present everywhere (eg. on i386), so check for it. Individual +dnl tests also need to check that qemu-img is present. +AC_CHECK_PROGS([QEMU_IMG], [qemu-img], [no]) +AM_CONDITIONAL([HAVE_QEMU_IMG], [test "x$QEMU_IMG" != "xno"]) + HEADING([Checking for bash completion]) dnl Bash completion. @@ -889,6 +901,7 @@ AS_IF([test "x$with_bash_completions" != xno], [ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [ + PRINT_PKG_VERSION([bash-completion]) bash_completion=yes AC_MSG_CHECKING([for bash-completions directory]) m4_ifdef([PKG_CHECK_VAR],[ @@ -1208,6 +1221,7 @@ [enable_tcl=yes]) AS_IF([test "x$enable_tcl" != "xno"],[ PKG_CHECK_MODULES([TCL], [tcl], [ + PRINT_PKG_VERSION(tcl) AC_SUBST([TCL_CFLAGS]) AC_SUBST([TCL_LIBS]) ],[ @@ -1226,6 +1240,7 @@ [enable_lua=yes]) AS_IF([test "x$enable_lua" != "xno"],[ PKG_CHECK_MODULES([LUA], [lua], [ + PRINT_PKG_VERSION(lua) AC_SUBST([LUA_CFLAGS]) AC_SUBST([LUA_LIBS]) @@ -1282,7 +1297,7 @@ [with_libblkio=check]) AS_IF([test "$with_libblkio" != "no"],[ PKG_CHECK_MODULES([LIBBLKIO], [blkio],[ - printf "libblkio version is "; $PKG_CONFIG --modversion blkio + PRINT_PKG_VERSION(blkio) AC_SUBST([LIBBLKIO_CFLAGS]) AC_SUBST([LIBBLKIO_LIBS]) AC_DEFINE([HAVE_LIBBLKIO],[1],[libblkio found at compile time.]) @@ -1299,7 +1314,7 @@ [with_curl=check]) AS_IF([test "$with_curl" != "no"],[ PKG_CHECK_MODULES([CURL], [libcurl],[ - printf "libcurl version is "; $PKG_CONFIG --modversion libcurl + PRINT_PKG_VERSION(libcurl) AC_SUBST([CURL_CFLAGS]) AC_SUBST([CURL_LIBS]) AC_DEFINE([HAVE_CURL],[1],[curl found at compile time.]) @@ -1364,7 +1379,7 @@ [with_ssh=check]) AS_IF([test "$with_ssh" != "no"],[ PKG_CHECK_MODULES([SSH], [libssh >= 0.8.0],[ - printf "libssh version is "; $PKG_CONFIG --modversion libssh + PRINT_PKG_VERSION(libssh) # Ubuntu 18.04 shipped prerelease of libssh-0.8.0 without # SSH_OPTIONS_NODELAY old_CFLAGS="$CFLAGS" @@ -1391,7 +1406,7 @@ [with_nfs=check]) AS_IF([test "$with_nfs" != "no"],[ PKG_CHECK_MODULES([LIBNFS], [libnfs >= 16],[ - printf "libnfs internal version is "; $PKG_CONFIG --modversion libnfs + PRINT_PKG_VERSION(libnfs) AC_SUBST([LIBNFS_CFLAGS]) AC_SUBST([LIBNFS_LIBS]) @@ -1455,6 +1470,7 @@ [with_libvirt=check]) AS_IF([test "$with_libvirt" != "no"],[ PKG_CHECK_MODULES([LIBVIRT], [libvirt],[ + PRINT_PKG_VERSION(libvirt) AC_SUBST([LIBVIRT_CFLAGS]) AC_SUBST([LIBVIRT_LIBS]) AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.]) @@ -1471,6 +1487,7 @@ [with_bzip2=check]) AS_IF([test "$with_bzip2" != "no"],[ PKG_CHECK_MODULES([BZLIB], [bzip2],[ + PRINT_PKG_VERSION(bzip2) AC_SUBST([BZLIB_CFLAGS]) AC_SUBST([BZLIB_LIBS]) AC_DEFINE([HAVE_BZLIB],[1],[libbz2 found at compile time.]) @@ -1489,6 +1506,7 @@ [with_zlib=check]) AS_IF([test "$with_zlib" != "no"],[ PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3.5],[ + PRINT_PKG_VERSION(zlib) AC_SUBST([ZLIB_CFLAGS]) AC_SUBST([ZLIB_LIBS]) AC_DEFINE([HAVE_ZLIB],[1],[zlib found at compile time.]) @@ -1505,6 +1523,7 @@ [with_zlib_ng=check]) AS_IF([test "$with_zlib_ng" != "no"],[ PKG_CHECK_MODULES([ZLIB_NG], [zlib-ng],[ + PRINT_PKG_VERSION([zlib-ng]) AC_SUBST([ZLIB_NG_CFLAGS]) AC_SUBST([ZLIB_NG_LIBS]) AC_DEFINE([HAVE_ZLIB_NG],[1],[zlib-ng found at compile time.]) @@ -1522,7 +1541,7 @@ [with_libnbd=check]) AS_IF([test "$with_libnbd" != "no"],[ PKG_CHECK_MODULES([LIBNBD], [libnbd >= 0.9.8],[ - printf "libnbd version is "; $PKG_CONFIG --modversion libnbd + PRINT_PKG_VERSION(libnbd) AC_SUBST([LIBNBD_CFLAGS]) AC_SUBST([LIBNBD_LIBS]) AC_DEFINE([HAVE_LIBNBD],[1],[libnbd found at compile time.]) @@ -1546,6 +1565,7 @@ [with_liblzma=check]) AS_IF([test "$with_liblzma" != "no"],[ PKG_CHECK_MODULES([LIBLZMA], [liblzma],[ + PRINT_PKG_VERSION(liblzma) AC_SUBST([LIBLZMA_CFLAGS]) AC_SUBST([LIBLZMA_LIBS]) AC_DEFINE([HAVE_LIBLZMA],[1],[liblzma found at compile time.]) @@ -1578,6 +1598,7 @@ [with_libzstd=check]) AS_IF([test "$with_libzstd" != "no"],[ PKG_CHECK_MODULES([LIBZSTD], [libzstd],[ + PRINT_PKG_VERSION(libzstd) AC_SUBST([LIBZSTD_CFLAGS]) AC_SUBST([LIBZSTD_LIBS]) AC_DEFINE([HAVE_LIBZSTD],[1],[libzstd found at compile time.]) @@ -1595,6 +1616,7 @@ [with_libguestfs=check]) AS_IF([test "$with_libguestfs" != "no"],[ PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs],[ + PRINT_PKG_VERSION(libguestfs) # Although the library was found, we want to make sure it supports nbd AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <guestfs.h> @@ -1656,12 +1678,14 @@ [with_ext2=check]) AS_IF([test "$with_ext2" != "no"], [ PKG_CHECK_MODULES([EXT2FS], [ext2fs], [ + PRINT_PKG_VERSION(ext2fs) AC_SUBST([EXT2FS_CFLAGS]) AC_SUBST([EXT2FS_LIBS]) AC_DEFINE([HAVE_EXT2FS],[1],[ext2fs found at compile time.]) ], [AC_MSG_WARN([ext2fs not found, ext2 filter will be disabled])]) PKG_CHECK_MODULES([COM_ERR], [com_err], [ + PRINT_PKG_VERSION([com_err]) AC_SUBST([COM_ERR_CFLAGS]) AC_SUBST([COM_ERR_LIBS]) AC_DEFINE([HAVE_COM_ERR],[1],[com_err found at compile time.]) @@ -1683,6 +1707,7 @@ ) AS_IF([test "x$enable_torrent" != "xno"], [ PKG_CHECK_MODULES([LIBTORRENT], [libtorrent-rasterbar], [ + PRINT_PKG_VERSION([libtorrent-rasterbar]) AC_SUBST([LIBTORRENT_CFLAGS]) AC_SUBST([LIBTORRENT_LIBS]) ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/docs/nbdkit-probing.pod new/nbdkit-1.44.4/docs/nbdkit-probing.pod --- old/nbdkit-1.44.3/docs/nbdkit-probing.pod 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/docs/nbdkit-probing.pod 2025-10-27 12:43:44.000000000 +0100 @@ -4,15 +4,15 @@ =head1 SYNOPSIS - nbdkit --dump-config + nbdkit --version =for paragraph - nbdkit PLUGIN --dump-plugin + nbdkit --dump-config =for paragraph - nbdkit --version + nbdkit PLUGIN --dump-plugin =for paragraph diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/docs/nbdkit.pod new/nbdkit-1.44.4/docs/nbdkit.pod --- old/nbdkit-1.44.3/docs/nbdkit.pod 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/docs/nbdkit.pod 2025-10-27 12:43:44.000000000 +0100 @@ -1,6 +1,6 @@ =head1 NAME -nbdkit - toolkit for creating Network Block Device (NBD) servers +nbdkit - network block device (NBD) server =head1 SYNOPSIS @@ -12,10 +12,9 @@ devices over the network. Block devices are hard disks and things that behave like hard disks such as disk images and virtual machines. -nbdkit is both a toolkit for creating NBD servers from -“unconventional” sources, and the name of an NBD server. nbdkit ships -with many plugins for performing common tasks like serving local -files. +nbdkit is an NBD server, and also a powerful toolkit for creating your +own NBD servers from “unconventional” sources. nbdkit ships with many +plugins for performing common tasks like serving local files. =head2 Plugins and filters @@ -319,7 +318,7 @@ =item B<--log=null> -=item B<--log=/path> +=item B<--log=>/path =item B<--log=default> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/filters/ext2/nbdkit-ext2-filter.pod new/nbdkit-1.44.4/filters/ext2/nbdkit-ext2-filter.pod --- old/nbdkit-1.44.3/filters/ext2/nbdkit-ext2-filter.pod 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/filters/ext2/nbdkit-ext2-filter.pod 2025-10-27 12:43:44.000000000 +0100 @@ -37,11 +37,6 @@ particular we may have to replay the ext3 journal in order to open a filesystem even read-only. -The filter does I<not> support multiple parallel connections, because -there is a risk of corrupting the filesystem (as if the filesystem was -mounted by multiple machines). If a second connection is made to -nbdkit, it will block until the first connection closes. - The filter is implemented using the ext2fs library which is provided in most Linux distros, and also available as part of the e2fsprogs project. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/plugins/data/format.c new/nbdkit-1.44.4/plugins/data/format.c --- old/nbdkit-1.44.3/plugins/data/format.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/plugins/data/format.c 2025-10-27 12:43:44.000000000 +0100 @@ -210,8 +210,8 @@ expr_t e = { .t = t }; va_list args; - /* Note that you cannot pass uint8_t through varargs, so for the - * byte fields we use int here. + /* Note that for varargs, uint8_t is automatically promoted to int + * (note: signed), so for the byte fields we use int here. */ va_start (args, t); switch (t) { @@ -634,7 +634,7 @@ } id = list.ptr[list.len-1]; list.len--; - APPEND_EXPR (new_node (expr (EXPR_SLICE, id, i64, m))); + APPEND_EXPR (new_node (expr (EXPR_SLICE, id, (uint64_t) i64, m))); break; case '<': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/plugins/linuxdisk/filesystem.c new/nbdkit-1.44.4/plugins/linuxdisk/filesystem.c --- old/nbdkit-1.44.3/plugins/linuxdisk/filesystem.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/plugins/linuxdisk/filesystem.c 2025-10-27 12:43:44.000000000 +0100 @@ -148,7 +148,7 @@ static int64_t estimate_size (void) { - CLEANUP_FREE char *command = NULL, *line = NULL; + CLEANUP_FREE char *command = NULL, *line = NULL, *lastline = NULL; size_t len = 0; FILE *fp; int64_t ret; @@ -177,8 +177,16 @@ /* Ignore everything up to the last line. */ len = 0; - while (getline (&line, &len, fp) != -1) - /* empty */; + while (getline (&line, &len, fp) != -1) { + nbdkit_debug ("du: %s", line); + free (lastline); + lastline = strndup (line, len); + if (lastline == NULL) { + nbdkit_error ("strndup: %m"); + pclose (fp); + return -1; + } + } if (ferror (fp)) { nbdkit_error ("getline failed: %m"); pclose (fp); @@ -193,9 +201,14 @@ if (exit_status_to_nbd_error (r, "pclose: du") == -1) return -1; + if (lastline == NULL) { + nbdkit_error ("no output from du command"); + return -1; + } + /* Parse the last line. */ - if (sscanf (line, "%" SCNi64, &ret) != 1 || ret < 0) { - nbdkit_error ("could not parse last line of output: %s", line); + if (sscanf (lastline, "%" SCNi64, &ret) != 1 || ret < 0) { + nbdkit_error ("could not parse last line from du command: %s", lastline); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/plugins/ocaml/plugin.c new/nbdkit-1.44.4/plugins/ocaml/plugin.c --- old/nbdkit-1.44.3/plugins/ocaml/plugin.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/plugins/ocaml/plugin.c 2025-10-27 12:43:44.000000000 +0100 @@ -121,13 +121,6 @@ } static void -unregister_thread (void) -{ - void *val = pthread_getspecific (thread_key); - destroy_thread (val); -} - -static void destroy_thread (void *val) { if (val == &thread_key_non_main) { @@ -250,7 +243,11 @@ unload_wrapper (void) { register_thread (); - ACQUIRE_RUNTIME_FOR_CURRENT_SCOPE (); + /* NB: Don't call ACQUIRE_RUNTIME_FOR_CURRENT_SCOPE here since it + * will release the lock after caml_shutdown (which is a bug), and + * the runtime system must be locked when calling caml_shutdown. + */ + do_caml_acquire_runtime_system (); if (unload_fn) { caml_callback (unload_fn, Val_unit); @@ -478,7 +475,7 @@ close_wrapper (void *hv) { register_thread (); - do_caml_acquire_runtime_system (); + ACQUIRE_RUNTIME_FOR_CURRENT_SCOPE (); CAMLparam0 (); CAMLlocal1 (rv); struct handle *h = hv; @@ -490,8 +487,6 @@ caml_remove_generational_global_root (&h->v); free (h); - do_caml_release_runtime_system (); - unregister_thread (); CAMLreturn0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/plugins/vddk/nbdkit-vddk-plugin.pod new/nbdkit-1.44.4/plugins/vddk/nbdkit-vddk-plugin.pod --- old/nbdkit-1.44.3/plugins/vddk/nbdkit-vddk-plugin.pod 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/plugins/vddk/nbdkit-vddk-plugin.pod 2025-10-27 12:43:44.000000000 +0100 @@ -10,11 +10,11 @@ [create=true] [create-adapter-type=ide|scsi-buslogic|...] [create-hwversion=workstation4|workstation5|...] [create-size=...] [create-type=monolithic-sparse|...] - [libdir=LIBRARY] - [nfchostport=PORT] [single-link=true] + [libdir=LIBRARY] [nfchostport=PORT] [password=PASSWORD | password=- | password=+FILENAME | password=-FD] - [port=PORT] [server=HOSTNAME] [snapshot=MOREF] + [port=PORT] [server=HOSTNAME] + [single-link=true] [snapshot=MOREF] [thumbprint=THUMBPRINT] [transports=MODE:MODE:...] [unbuffered=true] [user=USERNAME] [vm=moref=ID] nbdkit vddk --dump-plugin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/plugins/vddk/vddk.c new/nbdkit-1.44.4/plugins/vddk/vddk.c --- old/nbdkit-1.44.3/plugins/vddk/vddk.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/plugins/vddk/vddk.c 2025-10-27 12:43:44.000000000 +0100 @@ -639,6 +639,7 @@ printf ("vddk_default_libdir=%s\n", VDDK_LIBDIR); printf ("vddk_has_nfchostport=1\n"); + printf ("vddk_has_fnm_pathname=0\n"); /* Because load_library (false) we might not have loaded VDDK, in * which case we didn't set library_version. Note this cannot @@ -744,7 +745,7 @@ goto err0; } - r = fnmatch (export_wildcard, nbd_export_name, FNM_PATHNAME); + r = fnmatch (export_wildcard, nbd_export_name, 0); switch (r) { case 0: /* OK */ break; case FNM_NOMATCH: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/server/public.c new/nbdkit-1.44.4/server/public.c --- old/nbdkit-1.44.3/server/public.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/server/public.c 2025-10-27 12:43:44.000000000 +0100 @@ -73,10 +73,10 @@ #include "array-size.h" #include "ascii-ctype.h" -#include "ascii-string.h" #include "get_current_dir_name.h" #include "getline.h" #include "human-size.h" +#include "parse-bool.h" #include "poll.h" #include "realpath.h" #include "strndup.h" @@ -403,24 +403,13 @@ NBDKIT_DLL_PUBLIC int nbdkit_parse_bool (const char *str) { - if (!strcmp (str, "1") || - !ascii_strcasecmp (str, "true") || - !ascii_strcasecmp (str, "t") || - !ascii_strcasecmp (str, "yes") || - !ascii_strcasecmp (str, "y") || - !ascii_strcasecmp (str, "on")) - return 1; - - if (!strcmp (str, "0") || - !ascii_strcasecmp (str, "false") || - !ascii_strcasecmp (str, "f") || - !ascii_strcasecmp (str, "no") || - !ascii_strcasecmp (str, "n") || - !ascii_strcasecmp (str, "off")) - return 0; - - nbdkit_error ("could not decipher boolean (%s)", str); - return -1; + int r = parse_bool (str); + if (r == -1) { + nbdkit_error ("could not decipher boolean (%s)", str); + return -1; + } + else + return r; } /* Parse a delay or sleep. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/Makefile.am new/nbdkit-1.44.4/tests/Makefile.am --- old/nbdkit-1.44.3/tests/Makefile.am 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/Makefile.am 2025-10-27 12:43:44.000000000 +0100 @@ -108,6 +108,7 @@ # skip if not present. if !IS_WINDOWS if HAVE_MKE2FS_WITH_D +if HAVE_QEMU_IMG check_DATA += disk disk.tar CLEANFILES += disk disk.tar @@ -117,7 +118,7 @@ mkdir disk.tmp echo -n "hello,world" > disk.tmp/hello.txt $(top_builddir)/nbdkit$(EXEEXT) -fv linuxdisk disk.tmp size=100M \ - --run 'qemu-img convert "$$uri" $@-t' + --run '@QEMU_IMG@ convert "$$uri" $@-t' rm -rf disk.tmp mv $@-t $@ @@ -172,6 +173,7 @@ endif HAVE_LZIP EXTRA_DIST += chunked-lzip.sh +endif HAVE_QEMU_IMG endif HAVE_MKE2FS_WITH_D endif !IS_WINDOWS @@ -1836,6 +1838,7 @@ EXTRA_DIST += test-exportname.sh # ext2 filter test. +if HAVE_QEMU_IMG if HAVE_MKE2FS_WITH_D if HAVE_EXT2 @@ -1865,6 +1868,7 @@ endif HAVE_EXT2 endif HAVE_MKE2FS_WITH_D +endif HAVE_QEMU_IMG # extentlist filter test. TESTS += test-extentlist.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/functions.sh.in new/nbdkit-1.44.4/tests/functions.sh.in --- old/nbdkit-1.44.3/tests/functions.sh.in 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/functions.sh.in 2025-10-27 12:43:44.000000000 +0100 @@ -56,6 +56,7 @@ EXEEXT="@EXEEXT@" CUT="@CUT@" +QEMU_IMG="@QEMU_IMG@" SED="@SED@" STAT="@STAT@" TRUNCATE="@TRUNCATE@" @@ -226,9 +227,9 @@ # requires program [args] # # Check that ‘program [args]’ works. If not, skip the test. -# For example to check that qemu-img is available, do: +# For example to check that 'jq' is available, do: # -# requires qemu-img --version +# requires jq --version requires () { ( "$@" ) </dev/null >/dev/null 2>&1 || { @@ -256,12 +257,12 @@ # https://lists.fedoraproject.org/archives/list/[email protected]/thread/SXDLSZ3GKXL6NDAKP4MPJ25IMHKN67X3/ requires_ipv6_loopback () { - requires qemu-img --version + requires "$QEMU_IMG" --version # This should fail with "Connection refused". If IPv6 is broken # then it fails with "Address family for hostname not supported" # instead. It's very unlikely that port 1 is open. - if LANG=C qemu-img info "nbd:[::1]:1" |& \ + if LANG=C "$QEMU_IMG" info "nbd:[::1]:1" |& \ grep -sq "Address family for hostname not supported"; then echo "$0: IPv6 loopback is not available, skipping this test" exit 77 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-cow.sh new/nbdkit-1.44.4/tests/test-cow.sh --- old/nbdkit-1.44.3/tests/test-cow.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-cow.sh 2025-10-27 12:43:44.000000000 +0100 @@ -39,7 +39,7 @@ requires_plugin linuxdisk requires guestfish --version requires_nbdcopy -requires qemu-img --version +requires "$QEMU_IMG" --version requires $STAT --version sock=$(mktemp -u /tmp/nbdkit-test-sock.XXXXXX) @@ -74,10 +74,10 @@ # If we have qemu-img, try the hairy rebase operation documented # in the nbdkit-cow-filter manual. -if qemu-img --version >/dev/null 2>&1; then - qemu-img create -F raw -b nbd:unix:$sock -f qcow2 cow-diff.qcow2 - time qemu-img rebase -F raw -b cow-base.img -f qcow2 cow-diff.qcow2 - qemu-img info cow-diff.qcow2 +if "$QEMU_IMG" --version >/dev/null 2>&1; then + "$QEMU_IMG" create -F raw -b nbd:unix:$sock -f qcow2 cow-diff.qcow2 + time "$QEMU_IMG" rebase -F raw -b cow-base.img -f qcow2 cow-diff.qcow2 + "$QEMU_IMG" info cow-diff.qcow2 # This checks the file we created exists. guestfish --ro -a cow-diff.qcow2 -m /dev/sda1 cat /hello diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-curl-cookie-script.c new/nbdkit-1.44.4/tests/test-curl-cookie-script.c --- old/nbdkit-1.44.3/tests/test-curl-cookie-script.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-curl-cookie-script.c 2025-10-27 12:43:44.000000000 +0100 @@ -81,6 +81,8 @@ skip_because ("curl does not support CURLOPT_UNIX_SOCKET_PATH"); #endif + requires_exists ("disk"); + sockpath = web_server ("disk", check_request, false); if (sockpath == NULL) { fprintf (stderr, "%s: could not start web server thread\n", program_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-curl-header-script.c new/nbdkit-1.44.4/tests/test-curl-header-script.c --- old/nbdkit-1.44.3/tests/test-curl-header-script.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-curl-header-script.c 2025-10-27 12:43:44.000000000 +0100 @@ -103,6 +103,8 @@ skip_because ("curl does not support CURLOPT_UNIX_SOCKET_PATH"); #endif + requires_exists ("disk"); + sockpath = web_server ("disk", check_request, false); if (sockpath == NULL) { fprintf (stderr, "%s: could not start web server thread\n", program_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-curl.c new/nbdkit-1.44.4/tests/test-curl.c --- old/nbdkit-1.44.3/tests/test-curl.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-curl.c 2025-10-27 12:43:44.000000000 +0100 @@ -81,6 +81,8 @@ skip_because ("curl does not support CURLOPT_UNIX_SOCKET_PATH"); #endif + requires_exists ("disk"); + sockpath = web_server ("disk", check_request, false); if (sockpath == NULL) { fprintf (stderr, "%s: could not start web server thread\n", program_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-data-extents.sh new/nbdkit-1.44.4/tests/test-data-extents.sh --- old/nbdkit-1.44.3/tests/test-data-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-data-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -37,8 +37,8 @@ requires_run requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help error_if_sparse_page_not_32768 out="test-data-extents.out" @@ -47,11 +47,13 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + do_test () { # We use jq to normalize the output and convert it to plain text. nbdkit data "$1" size="$2" \ - --run 'qemu-img map -f raw --output=json "$uri"' | + --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out if ! cmp $out $expected; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-extentlist.sh new/nbdkit-1.44.4/tests/test-extentlist.sh --- old/nbdkit-1.44.3/tests/test-extentlist.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-extentlist.sh 2025-10-27 12:43:44.000000000 +0100 @@ -39,8 +39,8 @@ requires_run requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help out=test-extentlist.out input=test-extentlist.in @@ -49,13 +49,15 @@ rm -f $files cleanup_fn rm $files +export QEMU_IMG + test () { nbdkit -v -D extentlist.lookup=1 \ -r \ --filter=extentlist \ null size=$1 extentlist=$input \ - --run 'qemu-img map -f raw --output=json "$uri"' | + --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out diff -u $out $expected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-file-extents.sh new/nbdkit-1.44.4/tests/test-file-extents.sh --- old/nbdkit-1.44.3/tests/test-file-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-file-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -42,8 +42,8 @@ requires_run requires test -f disk requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help # The file plugin must support reading file extents. requires sh -c 'nbdkit file --dump-plugin | grep file_extents=yes' @@ -58,11 +58,13 @@ stat disk || : stat -f disk || : -qemu-img map -f raw --output=json disk > test-file-extents.tmp +export QEMU_IMG + +"$QEMU_IMG" map -f raw --output=json disk > test-file-extents.tmp cat test-file-extents.tmp jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ < test-file-extents.tmp > test-file-extents.local -nbdkit file disk --run 'qemu-img map -f raw --output=json "$uri"' \ +nbdkit file disk --run '"$QEMU_IMG" map -f raw --output=json "$uri"' \ > test-file-extents.tmp cat test-file-extents.tmp jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-ipv4-lo.sh new/nbdkit-1.44.4/tests/test-ipv4-lo.sh --- old/nbdkit-1.44.3/tests/test-ipv4-lo.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-ipv4-lo.sh 2025-10-27 12:43:44.000000000 +0100 @@ -46,8 +46,8 @@ fi requires ip -V -requires qemu-img --version -requires qemu-img info --image-opts driver=file,filename=functions.sh +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" info --image-opts driver=file,filename=functions.sh rm -f ipv4lo.pid ipv4lo.out cleanup_fn rm -f ipv4lo.pid ipv4lo.out @@ -66,7 +66,7 @@ # Check we can connect over the IPv4 loopback interface. ipv4_lo="$(ip -o -4 addr show scope host)" if test -n "$ipv4_lo"; then - qemu-img info --output=json \ + "$QEMU_IMG" info --output=json \ --image-opts "file.driver=nbd,file.host=127.0.0.1,file.port=$port" > ipv4lo.out cat ipv4lo.out grep -sq '"virtual-size": *104857600\b' ipv4lo.out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-ipv6-lo.sh new/nbdkit-1.44.4/tests/test-ipv6-lo.sh --- old/nbdkit-1.44.3/tests/test-ipv6-lo.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-ipv6-lo.sh 2025-10-27 12:43:44.000000000 +0100 @@ -46,8 +46,8 @@ fi requires ip -V -requires qemu-img --version -requires qemu-img info --image-opts driver=file,filename=functions.sh +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" info --image-opts driver=file,filename=functions.sh requires_ipv6_loopback rm -f ipv6lo.pid ipv6lo.out @@ -67,7 +67,7 @@ # Check we can connect over the IPv6 loopback interface. ipv6_lo="$(ip -o -6 addr show scope host)" if test -n "$ipv6_lo"; then - qemu-img info --output=json \ + "$QEMU_IMG" info --output=json \ --image-opts "file.driver=nbd,file.host=::1,file.port=$port" > ipv6lo.out cat ipv6lo.out grep -sq '"virtual-size": *104857600\b' ipv6lo.out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-last-error.sh new/nbdkit-1.44.4/tests/test-last-error.sh --- old/nbdkit-1.44.3/tests/test-last-error.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-last-error.sh 2025-10-27 12:43:44.000000000 +0100 @@ -40,17 +40,17 @@ requires_run requires_plugin eval -requires qemu-img --version +requires "$QEMU_IMG" --version out=last-error.out rm -f $out cleanup_fn rm -f $out -export out +export out QEMU_IMG nbdkit eval \ open=' echo EPERM Go Away >&2; exit 1 ' get_size=' echo 0 ' \ - --run ' qemu-img info "$uri" > $out 2>&1 ||: ' + --run ' "$QEMU_IMG" info "$uri" > $out 2>&1 ||: ' cat $out grep "Go Away" $out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-luks-copy-zero.sh new/nbdkit-1.44.4/tests/test-luks-copy-zero.sh --- old/nbdkit-1.44.3/tests/test-luks-copy-zero.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-luks-copy-zero.sh 2025-10-27 12:43:44.000000000 +0100 @@ -38,7 +38,7 @@ set -x set -u -requires qemu-img --version +requires "$QEMU_IMG" --version requires_nbdcopy requires_run requires $TRUNCATE --version @@ -55,7 +55,7 @@ rm -f $encrypt_disk $zero_disk # Create an empty encrypted disk container. -qemu-img create -f luks \ +"$QEMU_IMG" create -f luks \ --object secret,data=123456,id=sec0 \ -o key-secret=sec0 \ $encrypt_disk 100M diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-luks-copy.sh new/nbdkit-1.44.4/tests/test-luks-copy.sh --- old/nbdkit-1.44.3/tests/test-luks-copy.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-luks-copy.sh 2025-10-27 12:43:44.000000000 +0100 @@ -38,8 +38,9 @@ requires_nbdcopy requires nbdsh --version requires_nbdsh_uri -requires qemu-img --version -requires bash -c 'qemu-img --help | grep -- --target-image-opts' +requires "$QEMU_IMG" --version +export QEMU_IMG +requires bash -c '"$QEMU_IMG" --help | grep -- --target-image-opts' requires hexdump --version requires $TRUNCATE --version requires_filter luks @@ -66,12 +67,12 @@ # starts with random plaintext. # # https://stackoverflow.com/a/44669936 -qemu-img create -f luks \ +"$QEMU_IMG" create -f luks \ --object secret,data=123456,id=sec0 \ -o key-secret=sec0 \ $encrypt_disk 1M $TRUNCATE -s 1M $plain_disk -qemu-img convert --target-image-opts -n \ +"$QEMU_IMG" convert --target-image-opts -n \ --object secret,data=123456,id=sec0 \ $plain_disk \ driver=luks,file.filename=$encrypt_disk,key-secret=sec0 @@ -110,7 +111,7 @@ # Use qemu to copy out the whole disk. Note we called flush() above # so the disk should be synchronised. -qemu-img convert --image-opts \ +"$QEMU_IMG" convert --image-opts \ --object secret,data=123456,id=sec0 \ driver=luks,file.filename=$encrypt_disk,key-secret=sec0 \ $plain_disk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-luks-info.sh new/nbdkit-1.44.4/tests/test-luks-info.sh --- old/nbdkit-1.44.3/tests/test-luks-info.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-luks-info.sh 2025-10-27 12:43:44.000000000 +0100 @@ -37,7 +37,7 @@ requires_nbdinfo requires_run -requires qemu-img --version +requires "$QEMU_IMG" --version requires_filter luks # Test fails on macOS (darwin) because of: @@ -53,7 +53,7 @@ cleanup_fn rm -f $disk $info rm -f $disk $info -qemu-img create -f luks \ +"$QEMU_IMG" create -f luks \ --object secret,data=123456,id=sec0 \ -o key-secret=sec0 \ $disk 1M diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-nbd-extents.sh new/nbdkit-1.44.4/tests/test-nbd-extents.sh --- old/nbdkit-1.44.3/tests/test-nbd-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-nbd-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -37,8 +37,8 @@ requires_run requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help error_if_sparse_page_not_32768 # Because of macOS SIP misfeature the DYLD_* environment variable @@ -58,6 +58,8 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + do_test () { start_nbdkit -P "$4" -U "$sock" \ @@ -66,7 +68,7 @@ truncate="$3" # We use jq to normalize the output and convert it to plain text. nbdkit nbd socket="$sock" \ - --run 'qemu-img map -f raw --output=json "$uri"' | + --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out rm -f "$sock" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-nbd-qcow2.sh new/nbdkit-1.44.4/tests/test-nbd-qcow2.sh --- old/nbdkit-1.44.3/tests/test-nbd-qcow2.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-nbd-qcow2.sh 2025-10-27 12:43:44.000000000 +0100 @@ -38,7 +38,7 @@ requires test -f disk requires guestfish --version requires_nbdinfo -requires qemu-img --version +requires "$QEMU_IMG" --version requires qemu-nbd --version disk=nbd-qcow2-disk.qcow2 @@ -49,7 +49,7 @@ cleanup_fn rm -f $files # Create a qcow2 disk for testing. -qemu-img convert -f raw disk -O qcow2 $disk +"$QEMU_IMG" convert -f raw disk -O qcow2 $disk # Run qemu-nbd via nbdkit with the partition filter. start_nbdkit -P $pid -U $sock \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-nbd-tls-psk.sh new/nbdkit-1.44.4/tests/test-nbd-tls-psk.sh --- old/nbdkit-1.44.3/tests/test-nbd-tls-psk.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-nbd-tls-psk.sh 2025-10-27 12:43:44.000000000 +0100 @@ -35,7 +35,7 @@ set -x set -u -requires qemu-img --version +requires "$QEMU_IMG" --version requires_tls_psk # Does the nbd plugin support TLS? @@ -63,7 +63,7 @@ tls=require tls-psk="$pskfile" tls-username=qemu socket="$sock1" # Run unencrypted client in background, so that retry will be required -qemu-img info --output=json -f raw "nbd+unix:///?socket=$sock2" \ +"$QEMU_IMG" info --output=json -f raw "nbd+unix:///?socket=$sock2" \ > nbd-tls-psk.out & info_pid=$! sleep 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-nbd-tls.sh new/nbdkit-1.44.4/tests/test-nbd-tls.sh --- old/nbdkit-1.44.3/tests/test-nbd-tls.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-nbd-tls.sh 2025-10-27 12:43:44.000000000 +0100 @@ -35,7 +35,7 @@ set -x set -u -requires qemu-img --version +requires "$QEMU_IMG" --version requires_tls_certificates # Does the nbd plugin support TLS? @@ -65,7 +65,7 @@ example1 # Run unencrypted client -qemu-img info --output=json -f raw "nbd+unix:///?socket=$sock2" > nbd-tls.out +"$QEMU_IMG" info --output=json -f raw "nbd+unix:///?socket=$sock2" > nbd-tls.out cat nbd-tls.out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-null-extents.sh new/nbdkit-1.44.4/tests/test-null-extents.sh --- old/nbdkit-1.44.3/tests/test-null-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-null-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -37,8 +37,8 @@ requires_run requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help out="test-null-extents.out" expected="test-null-extents.expected" @@ -46,12 +46,14 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + do_test () { # We use jq to normalize the output and convert it to plain text. nbdkit \ null "$1" \ - --run 'qemu-img map -f raw --output=json "$uri"' | + --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out if ! cmp $out $expected; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-ocaml-errorcodes.c new/nbdkit-1.44.4/tests/test-ocaml-errorcodes.c --- old/nbdkit-1.44.3/tests/test-ocaml-errorcodes.c 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-ocaml-errorcodes.c 2025-10-27 12:43:44.000000000 +0100 @@ -58,6 +58,7 @@ { 3*512, ENOMEM }, { 4*512, ESHUTDOWN }, { 5*512, EINVAL }, + { 6*512, 0 }, }; int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-offset-extents.sh new/nbdkit-1.44.4/tests/test-offset-extents.sh --- old/nbdkit-1.44.3/tests/test-offset-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-offset-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -37,8 +37,8 @@ requires_run requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help error_if_sparse_page_not_32768 out="test-offset-extents.out" @@ -47,6 +47,8 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + do_test () { # We use jq to normalize the output and convert it to plain text. @@ -54,7 +56,7 @@ --filter=offset \ data "$1" size="$2" \ offset=1024 range=65536 \ - --run 'qemu-img map -f raw --output=json "$uri"' | + --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out if ! cmp $out $expected; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-ondemand.sh new/nbdkit-1.44.4/tests/test-ondemand.sh --- old/nbdkit-1.44.3/tests/test-ondemand.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-ondemand.sh 2025-10-27 12:43:44.000000000 +0100 @@ -43,7 +43,7 @@ # Note we test both qemu-img info and nbdinfo in order to exercise the # lesser-used exportname paths in both tools. -requires qemu-img --version +requires "$QEMU_IMG" --version requires_nbdinfo dir=$(mktemp -d /tmp/nbdkit-test-dir.XXXXXX) @@ -72,13 +72,13 @@ errors=0 for e in /bad bad/bad .bad . .. ./etc ; do if nbdinfo "nbd+unix:///$e?socket=$sock"; then ((errors++)) ||:; fi - if qemu-img info nbd:unix:$sock:exportname=$e; then ((errors++)) ||:; fi + if "$QEMU_IMG" info nbd:unix:$sock:exportname=$e; then ((errors++)) ||:; fi # QEMU 9.1 switched to glib to parse URIs, and this munges URIs # that contain ".", "..", and various other things: # https://gitlab.com/qemu-project/qemu/-/issues/2584 # So we must skip URI-based tests for some URIs. if test "$e" != "." && test "$e" != ".." && test "$e" != "./etc"; then - if qemu-img info "nbd+unix:///$e?socket=$sock" + if "$QEMU_IMG" info "nbd+unix:///$e?socket=$sock" then ((errors++)) ||:; fi fi done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-qcow2dec-map.sh new/nbdkit-1.44.4/tests/test-qcow2dec-map.sh --- old/nbdkit-1.44.3/tests/test-qcow2dec-map.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-qcow2dec-map.sh 2025-10-27 12:43:44.000000000 +0100 @@ -38,7 +38,7 @@ requires_run requires test -f disk requires_nbdinfo -requires qemu-img --version +requires "$QEMU_IMG" --version requires qemu-nbd --version requires diff --version @@ -54,7 +54,7 @@ cleanup_fn rm -f $files # Create a qcow2 disk for testing. -qemu-img convert -f raw disk -O qcow2 $qcow2 -c +"$QEMU_IMG" convert -f raw disk -O qcow2 $qcow2 -c # Get the expected map from qemu-nbd. nbdinfo --map -- [ qemu-nbd -r -f qcow2 $qcow2 ] > $map_expected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-qcow2dec.sh new/nbdkit-1.44.4/tests/test-qcow2dec.sh --- old/nbdkit-1.44.3/tests/test-qcow2dec.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-qcow2dec.sh 2025-10-27 12:43:44.000000000 +0100 @@ -39,7 +39,7 @@ requires test -f disk requires_nbdcopy requires_nbdinfo -requires qemu-img --version +requires "$QEMU_IMG" --version requires cmp --version # Check nbdinfo supports the --is flag (not RHEL 8). @@ -54,8 +54,8 @@ cleanup_fn rm -f $files # Create a qcow2 disk for testing. -qemu-img convert -f raw disk -O qcow2 $qcow2 -c -#qemu-img convert -f raw disk -O qcow2 $qcow2 -c -o compression_type=zstd +"$QEMU_IMG" convert -f raw disk -O qcow2 $qcow2 -c +#"$QEMU_IMG" convert -f raw disk -O qcow2 $qcow2 -c -o compression_type=zstd # Start nbdkit. start_nbdkit -P $pid -U $sock \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-sh-extents.sh new/nbdkit-1.44.4/tests/test-sh-extents.sh --- old/nbdkit-1.44.3/tests/test-sh-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-sh-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -38,8 +38,8 @@ requires_run requires_plugin sh requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help out="test-sh-extents.out" expected="test-sh-extents.expected" @@ -47,10 +47,12 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + do_test () { # We use jq to normalize the output and convert it to plain text. - nbdkit -v sh - --run 'qemu-img map -f raw --output=json "$uri"' | + nbdkit -v sh - --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out if ! cmp $out $expected; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-tar-info-xz-qcow2dec.sh new/nbdkit-1.44.4/tests/test-tar-info-xz-qcow2dec.sh --- old/nbdkit-1.44.3/tests/test-tar-info-xz-qcow2dec.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-tar-info-xz-qcow2dec.sh 2025-10-27 12:43:44.000000000 +0100 @@ -41,8 +41,8 @@ requires_run requires test -f disk requires tar --version -requires qemu-img --version -requires qemu-img info --output=json /dev/null +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" info --output=json /dev/null requires_nbdcopy requires jq --version requires $STAT --version @@ -57,8 +57,10 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + # Create a tar file containing a known qcow2 file. -qemu-img convert -f raw disk -O qcow2 $disk +"$QEMU_IMG" convert -f raw disk -O qcow2 $disk tar cf $tar $disk xz --best --block-size=32768 $tar @@ -67,7 +69,7 @@ --filter=qcow2dec \ --filter=tar tar-entry=$disk \ --filter=xz \ - --run 'qemu-img info --output=json "$uri"' > $out + --run '"$QEMU_IMG" info --output=json "$uri"' > $out cat $out # Check various fields in the input. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-tar-info-xz.sh new/nbdkit-1.44.4/tests/test-tar-info-xz.sh --- old/nbdkit-1.44.3/tests/test-tar-info-xz.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-tar-info-xz.sh 2025-10-27 12:43:44.000000000 +0100 @@ -43,8 +43,8 @@ requires_filter xz requires test -f disk requires tar --version -requires qemu-img --version -requires qemu-img info --output=json /dev/null +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" info --output=json /dev/null requires jq --version requires $STAT --version requires xz --version @@ -58,15 +58,17 @@ cleanup_fn rm -f $files # Create a tar file containing a known qcow2 file. -qemu-img convert -f raw disk -O qcow2 $disk +"$QEMU_IMG" convert -f raw disk -O qcow2 $disk tar cf $tar $disk xz --best --block-size=32768 $tar +export QEMU_IMG + # Run nbdkit. nbdkit file $tar_xz \ --filter=tar tar-entry=$disk \ --filter=xz \ - --run 'qemu-img info --output=json "$uri"' > $out + --run '"$QEMU_IMG" info --output=json "$uri"' > $out cat $out # Check various fields in the input. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-tar-info.sh new/nbdkit-1.44.4/tests/test-tar-info.sh --- old/nbdkit-1.44.3/tests/test-tar-info.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-tar-info.sh 2025-10-27 12:43:44.000000000 +0100 @@ -40,8 +40,8 @@ requires_run requires test -f disk requires tar --version -requires qemu-img --version -requires qemu-img info --output=json /dev/null +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" info --output=json /dev/null requires jq --version requires $STAT --version @@ -52,14 +52,16 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + # Create a tar file containing a known qcow2 file. -qemu-img convert -f raw disk -O qcow2 $disk +"$QEMU_IMG" convert -f raw disk -O qcow2 $disk tar cf $tar $disk # Run nbdkit. nbdkit file $tar \ --filter=tar tar-entry=$disk \ - --run 'qemu-img info --output=json "$uri"' > $out + --run '"$QEMU_IMG" info --output=json "$uri"' > $out cat $out # Check various fields in the input. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-truncate-extents.sh new/nbdkit-1.44.4/tests/test-truncate-extents.sh --- old/nbdkit-1.44.3/tests/test-truncate-extents.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-truncate-extents.sh 2025-10-27 12:43:44.000000000 +0100 @@ -37,8 +37,8 @@ requires_run requires jq --version -requires qemu-img --version -requires qemu-img map --help +requires "$QEMU_IMG" --version +requires "$QEMU_IMG" map --help error_if_sparse_page_not_32768 out="test-truncate-extents.out" @@ -47,6 +47,8 @@ rm -f $files cleanup_fn rm -f $files +export QEMU_IMG + do_test () { # We use jq to normalize the output and convert it to plain text. @@ -54,7 +56,7 @@ --filter=truncate \ data "$1" size="$2" \ truncate="$3" \ - --run 'qemu-img map -f raw --output=json "$uri"' | + --run '"$QEMU_IMG" map -f raw --output=json "$uri"' | jq -c '.[] | {start:.start, length:.length, data:.data, zero:.zero}' \ > $out if ! cmp $out $expected; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-truncate3.sh new/nbdkit-1.44.4/tests/test-truncate3.sh --- old/nbdkit-1.44.3/tests/test-truncate3.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-truncate3.sh 2025-10-27 12:43:44.000000000 +0100 @@ -38,7 +38,7 @@ set -x set -u -requires qemu-img --version +requires "$QEMU_IMG" --version sock=$(mktemp -u /tmp/nbdkit-test-sock.XXXXXX) files="truncate3.out truncate3.pid $sock" @@ -51,7 +51,7 @@ pattern 5G \ round-up=512 -qemu-img info --output=json nbd:unix:$sock > truncate3.out +"$QEMU_IMG" info --output=json nbd:unix:$sock > truncate3.out if ! grep '"virtual-size": *5368709120' truncate3.out; then echo "$0: unexpected output from truncate3 regression test:" cat truncate3.out diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-vddk-real-unaligned-chunk.sh new/nbdkit-1.44.4/tests/test-vddk-real-unaligned-chunk.sh --- old/nbdkit-1.44.3/tests/test-vddk-real-unaligned-chunk.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-vddk-real-unaligned-chunk.sh 2025-10-27 12:43:44.000000000 +0100 @@ -41,7 +41,7 @@ requires test "${vddkdir:-}" != "" requires test -d "$vddkdir" requires test -f "$vddkdir/lib64/libvixDiskLib.so" -requires qemu-img --version +requires "$QEMU_IMG" --version requires_nbdinfo requires $TRUNCATE --version requires dd --version @@ -63,7 +63,7 @@ # aligned to 128 sectors (chunk size). dd if=/dev/urandom of=$d/test.raw bs=512 count=$(( 3*128 )) $TRUNCATE -s $(( (4*128 + 3) * 512)) $d/test.raw -qemu-img convert -f raw $d/test.raw -O vmdk $d/test.vmdk +"$QEMU_IMG" convert -f raw $d/test.raw -O vmdk $d/test.vmdk # Read the map using VDDK. export d diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test-vddk-real.sh new/nbdkit-1.44.4/tests/test-vddk-real.sh --- old/nbdkit-1.44.3/tests/test-vddk-real.sh 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test-vddk-real.sh 2025-10-27 12:43:44.000000000 +0100 @@ -42,7 +42,7 @@ requires test -r /dev/urandom requires cmp --version requires dd --version -requires qemu-img --version +requires "$QEMU_IMG" --version requires_nbdcopy requires_nbdinfo skip_if_valgrind "because setting LD_LIBRARY_PATH breaks valgrind" @@ -67,7 +67,7 @@ rm -f $files cleanup_fn rm -f $files -qemu-img create -f vmdk $vmdk 10M +"$QEMU_IMG" create -f vmdk $vmdk 10M # Check first that the VDDK library can be fully loaded. We have to # check the log file for missing modules since they may not show up as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbdkit-1.44.3/tests/test_ocaml_errorcodes_plugin.ml new/nbdkit-1.44.4/tests/test_ocaml_errorcodes_plugin.ml --- old/nbdkit-1.44.3/tests/test_ocaml_errorcodes_plugin.ml 2025-08-23 18:53:58.000000000 +0200 +++ new/nbdkit-1.44.4/tests/test_ocaml_errorcodes_plugin.ml 2025-10-27 12:43:44.000000000 +0100 @@ -47,8 +47,11 @@ (* 3 *) Some (ENOMEM, "ENOMEM"); (* 4 *) Some (ESHUTDOWN, "ESHUTDOWN"); (* 5 *) Some (EINVAL, "EINVAL"); + (* 6 *) None (* no error *); |] +let name = "test-ocaml-errorcodes" + let open_connection _ = () let get_size () = Int64.mul (Array.length sectors |> Int64.of_int) sector_size @@ -59,10 +62,16 @@ | None -> Bigarray.Array1.fill buf '\000' | Some (err, str) -> NBDKit.set_error err; failwith str +let unload () = + (* A good way to find memory bugs: *) + Gc.compact (); + NBDKit.debug "%s plugin unloaded" name + let () = NBDKit.register_plugin - ~name: "test-ocaml-errorcodes" + ~name ~version: (NBDKit.version ()) + ~unload ~open_connection ~get_size
