diff --git a/0001-Add-mandir-to-dump-config-output.patch b/0001-Add-mandir-to-dump-config-output.patch index e55b4c1..d3703fb 100644 --- a/0001-Add-mandir-to-dump-config-output.patch +++ b/0001-Add-mandir-to-dump-config-output.patch @@ -1,7 +1,7 @@ From 5294b7d8cc011f8b5e068aad744f612df7414a82 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 31 Oct 2015 13:24:52 +0000 -Subject: [PATCH 1/3] Add mandir to --dump-config output. +Subject: [PATCH 1/5] Add mandir to --dump-config output. This is useful for external plugins that want to install a man page. diff --git a/0002-Update-TODO.patch b/0002-Update-TODO.patch index e93c237..c59c910 100644 --- a/0002-Update-TODO.patch +++ b/0002-Update-TODO.patch @@ -1,7 +1,7 @@ From 4b562134c3dad1a84aa92c1658e72046569e1570 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 11 Jan 2016 15:34:57 +0000 -Subject: [PATCH 2/3] Update TODO. +Subject: [PATCH 2/5] Update TODO. --- TODO | 5 +++++ diff --git a/0003-Add-support-for-newstyle-NBD-protocol-RHBZ-1297100.patch b/0003-Add-support-for-newstyle-NBD-protocol-RHBZ-1297100.patch index 212f6fa..940b242 100644 --- a/0003-Add-support-for-newstyle-NBD-protocol-RHBZ-1297100.patch +++ b/0003-Add-support-for-newstyle-NBD-protocol-RHBZ-1297100.patch @@ -1,7 +1,7 @@ From f93807114634d58ca2ef0d64f7637ebd87e48a50 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 11 Jan 2016 17:08:51 +0000 -Subject: [PATCH 3/3] Add support for newstyle NBD protocol (RHBZ#1297100). +Subject: [PATCH 3/5] Add support for newstyle NBD protocol (RHBZ#1297100). --- .gitignore | 1 + diff --git a/0004-xz-Fix-various-printf-warnings-on-32-bit.patch b/0004-xz-Fix-various-printf-warnings-on-32-bit.patch new file mode 100644 index 0000000..5919543 --- /dev/null +++ b/0004-xz-Fix-various-printf-warnings-on-32-bit.patch @@ -0,0 +1,49 @@ +From 0759d15aa3649d088eeae91fcd174d0b37e1ccde Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 11 Jan 2016 19:02:53 +0000 +Subject: [PATCH 4/5] xz: Fix various printf warnings on 32 bit. + +xzfile.c: In function 'xzfile_read_block': +xzfile.c:456:19: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'uint64_t {aka long long unsigned int}' [-Wformat=] + nbdkit_error ("malloc (%zu bytes): %m\n" + ^ +xz.c: In function 'xz_close': +xz.c:191:17: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'size_t {aka unsigned int}' [-Wformat=] + nbdkit_debug ("cache: hits = %" PRIu64 ", misses = %" PRIu64, + ^ +xz.c:191:17: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' [-Wformat=] +--- + plugins/xz/xz.c | 3 +-- + plugins/xz/xzfile.c | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/plugins/xz/xz.c b/plugins/xz/xz.c +index 9a1f5e5..437f798 100644 +--- a/plugins/xz/xz.c ++++ b/plugins/xz/xz.c +@@ -188,8 +188,7 @@ xz_close (void *handle) + + blkcache_get_stats (h->c, &stats); + +- nbdkit_debug ("cache: hits = %" PRIu64 ", misses = %" PRIu64, +- stats.hits, stats.misses); ++ nbdkit_debug ("cache: hits = %zu, misses = %zu", stats.hits, stats.misses); + + xzfile_close (h->xz); + free_blkcache (h->c); +diff --git a/plugins/xz/xzfile.c b/plugins/xz/xzfile.c +index fcc2937..3633099 100644 +--- a/plugins/xz/xzfile.c ++++ b/plugins/xz/xzfile.c +@@ -453,7 +453,7 @@ xzfile_read_block (xzfile *xz, uint64_t offset, + + data = malloc (*size_rtn); + if (data == NULL) { +- nbdkit_error ("malloc (%zu bytes): %m\n" ++ nbdkit_error ("malloc (%" PRIu64 " bytes): %m\n" + "NOTE: If this error occurs, you need to recompress your xz files with a smaller block size. Use: 'xz --block-size=16777216 ...'.", + *size_rtn); + goto err1; +-- +2.5.0 + diff --git a/0005-ocaml-Avoid-race-when-building-NBDKit.cmi.patch b/0005-ocaml-Avoid-race-when-building-NBDKit.cmi.patch new file mode 100644 index 0000000..b16153e --- /dev/null +++ b/0005-ocaml-Avoid-race-when-building-NBDKit.cmi.patch @@ -0,0 +1,28 @@ +From b6db2f65596470492f0ad76d1ed63ddb98b17167 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 11 Jan 2016 19:46:37 +0000 +Subject: [PATCH 5/5] ocaml: Avoid race when building NBDKit.cmi. + +If both the NBDKit.cmi and NBDKit.cmx builds run in parallel, both +will try to build NBDKit.cmi, resulting in a corrupt NBDKit.cmi file. +Avoid this by adding an extra dependency. +--- + plugins/ocaml/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/ocaml/Makefile.am b/plugins/ocaml/Makefile.am +index d4776b3..f63ba33 100644 +--- a/plugins/ocaml/Makefile.am ++++ b/plugins/ocaml/Makefile.am +@@ -43,7 +43,7 @@ ocamllib_DATA = NBDKit.mli NBDKit.cmi NBDKit.cmx NBDKit.o + NBDKit.cmi: NBDKit.mli + $(OCAMLC) -c $< + +-NBDKit.cmx: NBDKit.ml ++NBDKit.cmx: NBDKit.ml NBDKit.cmi + $(OCAMLOPT) $(OCAMLOPTFLAGS) -c $< + NBDKit.o: NBDKit.cmx + +-- +2.5.0 + diff --git a/nbdkit.spec b/nbdkit.spec index 9fa6e47..f23a77c 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -6,7 +6,7 @@ Name: nbdkit Version: 1.1.11 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NBD server License: BSD @@ -18,7 +18,9 @@ Source0: http://libguestfs.org/download/nbdkit/%{name}-%{version}.tar.gz Patch1: 0001-Add-mandir-to-dump-config-output.patch Patch2: 0002-Update-TODO.patch Patch3: 0003-Add-support-for-newstyle-NBD-protocol-RHBZ-1297100.patch -# Because patch3 patches Makefile.am, we need: +Patch4: 0004-xz-Fix-various-printf-warnings-on-32-bit.patch +Patch5: 0005-ocaml-Avoid-race-when-building-NBDKit.cmi.patch +# Because patch3 & patch5 patches Makefile.am, we need: BuildRequires: automake, autoconf, libtool BuildRequires: /usr/bin/pod2man @@ -360,7 +362,7 @@ make check %changelog -* Mon Jan 11 2016 Richard W.M. Jones - 1.1.11-2 +* Mon Jan 11 2016 Richard W.M. Jones - 1.1.11-3 - Add support for newstyle NBD protocol (RHBZ#1297100). * Sat Oct 31 2015 Richard W.M. Jones - 1.1.11-1