import CS nbdkit-1.38.5-2.el9
This commit is contained in:
parent
214f09b92f
commit
551364a3f9
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
SOURCES/libguestfs.keyring
|
SOURCES/libguestfs.keyring
|
||||||
SOURCES/nbdkit-1.38.3.tar.gz
|
SOURCES/nbdkit-1.38.5.tar.gz
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
cc1b37b9cfafa515aab3eefd345ecc59aac2ce7b SOURCES/libguestfs.keyring
|
cc1b37b9cfafa515aab3eefd345ecc59aac2ce7b SOURCES/libguestfs.keyring
|
||||||
442637a8da4527c50f9bac0762c31276c2d00796 SOURCES/nbdkit-1.38.3.tar.gz
|
c70e24853a2bd5eee4546014991a9487c2a4dcdb SOURCES/nbdkit-1.38.5.tar.gz
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
From 14a2646d4221d50b4b194d5dd2d6010808ea642b Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
||||||
Date: Sun, 14 Jul 2024 09:50:31 +0100
|
|
||||||
Subject: [PATCH] nbdkit 1.38: Fix inclusion of <gnutls/socket.h> with old
|
|
||||||
gnutls
|
|
||||||
|
|
||||||
Development branch commit 8ce65bac5a ("build: Move to minimum gnutls
|
|
||||||
>= 3.5.18") changed the way that <gnutls/socket.h> is included. I
|
|
||||||
didn't cherry pick this commit to the stable-1.38 branch since we
|
|
||||||
don't want to force people to update gnutls.
|
|
||||||
|
|
||||||
However when I cherry picked commit 47987e43bd ("server/crypto.c:
|
|
||||||
Check <gnutls/socket.h> works before including it"), I missed that
|
|
||||||
there was still a place where <gnutls/socket.h> was included (which
|
|
||||||
would have been fixed by the commit above).
|
|
||||||
|
|
||||||
The upshot is that compilation of nbdkit 1.38.3 fails on mingw:
|
|
||||||
|
|
||||||
In file included from ../../server/crypto.c:69:
|
|
||||||
/usr/i686-w64-mingw32/sys-root/mingw/include/gnutls/socket.h:32:10: fatal error: sys/socket.h: No such file or directory
|
|
||||||
32 | #include <sys/socket.h>
|
|
||||||
| ^~~~~~~~~~~~~~
|
|
||||||
compilation terminated.
|
|
||||||
|
|
||||||
Fixes: commit f889d822dd96bcf8c0427bd541d730d58b166d83
|
|
||||||
---
|
|
||||||
server/crypto.c | 3 ---
|
|
||||||
1 file changed, 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/server/crypto.c b/server/crypto.c
|
|
||||||
index 83970282..86843192 100644
|
|
||||||
--- a/server/crypto.c
|
|
||||||
+++ b/server/crypto.c
|
|
||||||
@@ -65,9 +65,6 @@
|
|
||||||
#else
|
|
||||||
#define TRY_KTLS 0
|
|
||||||
#endif
|
|
||||||
-#if TRY_KTLS
|
|
||||||
-#include <gnutls/socket.h>
|
|
||||||
-#endif
|
|
||||||
|
|
||||||
static int crypto_auth;
|
|
||||||
#define CRYPTO_AUTH_CERTIFICATES 1
|
|
||||||
--
|
|
||||||
2.43.0
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
From f39c63a79ffb888bd565eb49b0ee2590fad8fbb9 Mon Sep 17 00:00:00 2001
|
From e97b5ec6e7e7406688f68a5828e66ef46046fd9f Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Tue, 23 Jul 2024 14:46:41 +0100
|
Date: Tue, 23 Jul 2024 14:46:41 +0100
|
||||||
Subject: [PATCH] server: log: Move preserve errno to log_verror function
|
Subject: [PATCH] server: log: Move preserve errno to log_verror function
|
@ -1,4 +1,4 @@
|
|||||||
From 179227c7d6b0677dcd1dced55881e0d024745424 Mon Sep 17 00:00:00 2001
|
From ae28c97079cce7792c5954f67a418402a48ed0cf Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Wed, 24 Jul 2024 10:29:13 +0100
|
Date: Wed, 24 Jul 2024 10:29:13 +0100
|
||||||
Subject: [PATCH] server: Rename threadlocal_{set,get}_error to .._errno
|
Subject: [PATCH] server: Rename threadlocal_{set,get}_error to .._errno
|
@ -1,4 +1,4 @@
|
|||||||
From 334ab902477a0e1db4d70a5c809eafe49ab1fc6e Mon Sep 17 00:00:00 2001
|
From 00107f9d36fc6a1b33a1bde25e3239c520b82ab1 Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Wed, 24 Jul 2024 10:37:58 +0100
|
Date: Wed, 24 Jul 2024 10:37:58 +0100
|
||||||
Subject: [PATCH] server: Introduce threadlocal_{set,get}_last_error
|
Subject: [PATCH] server: Introduce threadlocal_{set,get}_last_error
|
@ -1,4 +1,4 @@
|
|||||||
From a0e3f9d58142b8c5e7bcc9b73da60778e6503d0b Mon Sep 17 00:00:00 2001
|
From 4cde9d78c4293e294f80376266cfce420f15a6ff Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Tue, 23 Jul 2024 15:28:06 +0100
|
Date: Tue, 23 Jul 2024 15:28:06 +0100
|
||||||
Subject: [PATCH] server: Take a thread-local copy of the last call to
|
Subject: [PATCH] server: Take a thread-local copy of the last call to
|
@ -1,4 +1,4 @@
|
|||||||
From 7128144273f5355d7705e09a99aa1b2359e7e823 Mon Sep 17 00:00:00 2001
|
From e121d8e1d39605043317cbdf28f60056e6681d56 Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Tue, 23 Jul 2024 15:45:04 +0100
|
Date: Tue, 23 Jul 2024 15:45:04 +0100
|
||||||
Subject: [PATCH] server: Send the last error to the NBD client
|
Subject: [PATCH] server: Send the last error to the NBD client
|
||||||
@ -92,7 +92,7 @@ index 6b3bc76f..c18d32e5 100644
|
|||||||
|
|
||||||
/* Reply to NBD_OPT_LIST with the plugin's list of export names.
|
/* Reply to NBD_OPT_LIST with the plugin's list of export names.
|
||||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||||
index 0664e109..9c321fcb 100644
|
index b670fbf9..d510807c 100644
|
||||||
--- a/tests/Makefile.am
|
--- a/tests/Makefile.am
|
||||||
+++ b/tests/Makefile.am
|
+++ b/tests/Makefile.am
|
||||||
@@ -276,6 +276,7 @@ TESTS += \
|
@@ -276,6 +276,7 @@ TESTS += \
|
28
SOURCES/0006-vddk-Include-stdbool.h.patch
Normal file
28
SOURCES/0006-vddk-Include-stdbool.h.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
From 47345a7a56c343e2cd559b736df685214ed75a9b Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Mon, 6 Jan 2025 15:22:05 +0000
|
||||||
|
Subject: [PATCH] vddk: Include <stdbool.h>
|
||||||
|
|
||||||
|
Since this file uses booleans.
|
||||||
|
|
||||||
|
Acked-by: Eric Blake <eblake@redhat.com>
|
||||||
|
(cherry picked from commit fe855addae44e45e2344a33bd3857c561587f12e)
|
||||||
|
---
|
||||||
|
plugins/vddk/worker.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/plugins/vddk/worker.c b/plugins/vddk/worker.c
|
||||||
|
index 467d00ca..5982fcea 100644
|
||||||
|
--- a/plugins/vddk/worker.c
|
||||||
|
+++ b/plugins/vddk/worker.c
|
||||||
|
@@ -34,6 +34,7 @@
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
+#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
59
SOURCES/0007-vddk-Cache-the-disk-size-in-the-handle.patch
Normal file
59
SOURCES/0007-vddk-Cache-the-disk-size-in-the-handle.patch
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
From 927cb4063da464aa2605ae87d1b1157146551a47 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Mon, 6 Jan 2025 16:47:55 +0000
|
||||||
|
Subject: [PATCH] vddk: Cache the disk size in the handle
|
||||||
|
|
||||||
|
No functional change here, we're just making sure we have the disk
|
||||||
|
size (in bytes) available in the handle.
|
||||||
|
|
||||||
|
Acked-by: Eric Blake <eblake@redhat.com>
|
||||||
|
(cherry picked from commit 2ba76db4a048471e997e508715081a70356f94f3)
|
||||||
|
---
|
||||||
|
plugins/vddk/vddk.c | 6 +++---
|
||||||
|
plugins/vddk/vddk.h | 3 +++
|
||||||
|
2 files changed, 6 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
|
||||||
|
index 27d53bd6..2a787453 100644
|
||||||
|
--- a/plugins/vddk/vddk.c
|
||||||
|
+++ b/plugins/vddk/vddk.c
|
||||||
|
@@ -875,19 +875,19 @@ vddk_get_size (void *handle)
|
||||||
|
{
|
||||||
|
struct vddk_handle *h = handle;
|
||||||
|
VixDiskLibInfo *info;
|
||||||
|
- int64_t size;
|
||||||
|
struct command info_cmd = { .type = INFO, .ptr = &info };
|
||||||
|
|
||||||
|
if (send_command_and_wait (h, &info_cmd) == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
- size = info->capacity * (int64_t)VIXDISKLIB_SECTOR_SIZE;
|
||||||
|
+ /* Compute the size and cache it into the handle. */
|
||||||
|
+ h->size = info->capacity * VIXDISKLIB_SECTOR_SIZE;
|
||||||
|
|
||||||
|
VDDK_CALL_START (VixDiskLib_FreeInfo, "info")
|
||||||
|
VixDiskLib_FreeInfo (info);
|
||||||
|
VDDK_CALL_END (VixDiskLib_FreeInfo, 0);
|
||||||
|
|
||||||
|
- return size;
|
||||||
|
+ return h->size;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Advertise most efficient block sizes. */
|
||||||
|
diff --git a/plugins/vddk/vddk.h b/plugins/vddk/vddk.h
|
||||||
|
index fb0c79a8..1d1069cc 100644
|
||||||
|
--- a/plugins/vddk/vddk.h
|
||||||
|
+++ b/plugins/vddk/vddk.h
|
||||||
|
@@ -165,6 +165,9 @@ struct vddk_handle {
|
||||||
|
command_queue commands; /* command queue */
|
||||||
|
pthread_cond_t commands_cond; /* condition (queue size 0 -> 1) */
|
||||||
|
uint64_t id; /* next command ID */
|
||||||
|
+
|
||||||
|
+ /* Cached disk size in bytes (set in get_size()). */
|
||||||
|
+ uint64_t size;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* reexec.c */
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
From 0ba2e0d3c53efd49309d9e274e0cb6c2e6720cbd Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Mon, 6 Jan 2025 15:37:54 +0000
|
||||||
|
Subject: [PATCH] vddk: do_extents: Mark some local variables const
|
||||||
|
|
||||||
|
These are never changed in the code (they are fields copied out from
|
||||||
|
the *cmd struct), so mark them as const.
|
||||||
|
|
||||||
|
Acked-by: Eric Blake <eblake@redhat.com>
|
||||||
|
(cherry picked from commit 24fd7df460ae31fe3f72b5100ca3dbe138bbadbe)
|
||||||
|
---
|
||||||
|
plugins/vddk/worker.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/plugins/vddk/worker.c b/plugins/vddk/worker.c
|
||||||
|
index 5982fcea..bc015d16 100644
|
||||||
|
--- a/plugins/vddk/worker.c
|
||||||
|
+++ b/plugins/vddk/worker.c
|
||||||
|
@@ -388,9 +388,9 @@ add_extent (struct nbdkit_extents *extents,
|
||||||
|
static int
|
||||||
|
do_extents (struct command *cmd, struct vddk_handle *h)
|
||||||
|
{
|
||||||
|
- uint32_t count = cmd->count;
|
||||||
|
- uint64_t offset = cmd->offset;
|
||||||
|
- bool req_one = cmd->req_one;
|
||||||
|
+ const uint32_t count = cmd->count;
|
||||||
|
+ const uint64_t offset = cmd->offset;
|
||||||
|
+ const bool req_one = cmd->req_one;
|
||||||
|
struct nbdkit_extents *extents = cmd->ptr;
|
||||||
|
uint64_t position, end, start_sector;
|
||||||
|
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
From 6dd8b5eb14c0723764dd39597d64f62162ca3ab3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Mon, 6 Jan 2025 16:39:51 +0000
|
||||||
|
Subject: [PATCH] vddk: do_extents: Exit the function if we hit req_one
|
||||||
|
condition
|
||||||
|
|
||||||
|
No change to the functionality, since the code previously called
|
||||||
|
'return 0' immediately following the loop.
|
||||||
|
|
||||||
|
Acked-by: Eric Blake <eblake@redhat.com>
|
||||||
|
(cherry picked from commit 2f4d71f8f704d89d69cd635791c3239d2f44d631)
|
||||||
|
---
|
||||||
|
plugins/vddk/worker.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/plugins/vddk/worker.c b/plugins/vddk/worker.c
|
||||||
|
index bc015d16..112111e3 100644
|
||||||
|
--- a/plugins/vddk/worker.c
|
||||||
|
+++ b/plugins/vddk/worker.c
|
||||||
|
@@ -471,7 +471,7 @@ do_extents (struct command *cmd, struct vddk_handle *h)
|
||||||
|
* overlapping the original offset we're done.
|
||||||
|
*/
|
||||||
|
if (req_one && position > offset)
|
||||||
|
- break;
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,202 @@
|
|||||||
|
From fdc2a6a9818aad25ee606118d5f6a32fa0739912 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Mon, 6 Jan 2025 15:45:35 +0000
|
||||||
|
Subject: [PATCH] vddk: do_extents: Avoid reading partial chunk beyond the end
|
||||||
|
of the disk
|
||||||
|
|
||||||
|
The QueryAllocatedBlocks API has (another) frustrating feature. It
|
||||||
|
can only query whole "chunks" (128 sectors). If the disk size is not
|
||||||
|
aligned to the chunk size (say the size was 129 sectors) then there's
|
||||||
|
a bit at the end which cannot be queried. Furthermore, the API gives
|
||||||
|
an error in this case instead of being helpful:
|
||||||
|
|
||||||
|
VixDiskLib_QueryAllocatedBlocks: One of the parameters was invalid
|
||||||
|
|
||||||
|
Fixes: https://issues.redhat.com/browse/RHEL-71694
|
||||||
|
Reported-by: Ming Xie <mxie@redhat.com>
|
||||||
|
Acked-by: Eric Blake <eblake@redhat.com>
|
||||||
|
(cherry picked from commit fd918f3d1a185fd996999766c75acb9d6e22395d)
|
||||||
|
---
|
||||||
|
plugins/vddk/worker.c | 29 ++++++++-
|
||||||
|
tests/Makefile.am | 5 +-
|
||||||
|
tests/test-vddk-real-unaligned-chunk.sh | 82 +++++++++++++++++++++++++
|
||||||
|
3 files changed, 113 insertions(+), 3 deletions(-)
|
||||||
|
create mode 100755 tests/test-vddk-real-unaligned-chunk.sh
|
||||||
|
|
||||||
|
diff --git a/plugins/vddk/worker.c b/plugins/vddk/worker.c
|
||||||
|
index 112111e3..8a91250a 100644
|
||||||
|
--- a/plugins/vddk/worker.c
|
||||||
|
+++ b/plugins/vddk/worker.c
|
||||||
|
@@ -392,10 +392,9 @@ do_extents (struct command *cmd, struct vddk_handle *h)
|
||||||
|
const uint64_t offset = cmd->offset;
|
||||||
|
const bool req_one = cmd->req_one;
|
||||||
|
struct nbdkit_extents *extents = cmd->ptr;
|
||||||
|
- uint64_t position, end, start_sector;
|
||||||
|
+ uint64_t position, start_sector, size_sectors, last_queryable_sector, end;
|
||||||
|
|
||||||
|
position = offset;
|
||||||
|
- end = offset + count;
|
||||||
|
|
||||||
|
/* We can only query whole chunks. Therefore start with the
|
||||||
|
* first chunk before offset.
|
||||||
|
@@ -403,6 +402,21 @@ do_extents (struct command *cmd, struct vddk_handle *h)
|
||||||
|
start_sector =
|
||||||
|
ROUND_DOWN (offset, VIXDISKLIB_MIN_CHUNK_SIZE * VIXDISKLIB_SECTOR_SIZE)
|
||||||
|
/ VIXDISKLIB_SECTOR_SIZE;
|
||||||
|
+
|
||||||
|
+ /* Calculate the end byte + 1 that we're going to query, normally
|
||||||
|
+ * this is offset + count.
|
||||||
|
+ *
|
||||||
|
+ * However since chunks are larger than sectors, for a disk which
|
||||||
|
+ * has size which is not aligned to the chunk size there is a part
|
||||||
|
+ * of the disk at the end that we can never query. Reduce 'end' to
|
||||||
|
+ * the maximum possible queryable part of the disk, and we'll deal
|
||||||
|
+ * with the unaligned bit after the loop (RHEL-71694).
|
||||||
|
+ */
|
||||||
|
+ end = offset + count;
|
||||||
|
+ size_sectors = h->size / VIXDISKLIB_SECTOR_SIZE;
|
||||||
|
+ last_queryable_sector = ROUND_DOWN (size_sectors, VIXDISKLIB_MIN_CHUNK_SIZE);
|
||||||
|
+ end = MIN (end, last_queryable_sector * VIXDISKLIB_SECTOR_SIZE);
|
||||||
|
+
|
||||||
|
while (start_sector * VIXDISKLIB_SECTOR_SIZE < end) {
|
||||||
|
VixError err;
|
||||||
|
uint32_t i;
|
||||||
|
@@ -474,6 +488,17 @@ do_extents (struct command *cmd, struct vddk_handle *h)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* If 'end' spanned beyond the last chunk of the disk, then we
|
||||||
|
+ * reduced it above to avoid reading a chunk that extends beyond the
|
||||||
|
+ * end of the underlying disk. We have to synthesize an allocated
|
||||||
|
+ * block here, which is what VDDK's example code does
|
||||||
|
+ * (doc/samples/diskLib/vixDiskLibSample.cpp: DoGetAllocatedBlocks).
|
||||||
|
+ */
|
||||||
|
+ if (end < offset + count) {
|
||||||
|
+ if (add_extent (extents, &position, offset + count, false) == -1)
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||||
|
index d510807c..0aa36846 100644
|
||||||
|
--- a/tests/Makefile.am
|
||||||
|
+++ b/tests/Makefile.am
|
||||||
|
@@ -178,7 +178,8 @@ if HAVE_VDDK
|
||||||
|
check-vddk:
|
||||||
|
$(MAKE) check TESTS="test-vddk-real.sh \
|
||||||
|
test-vddk-real-dump-plugin.sh \
|
||||||
|
- test-vddk-real-create.sh"
|
||||||
|
+ test-vddk-real-create.sh \
|
||||||
|
+ test-vddk-real-unaligned-chunk.sh"
|
||||||
|
endif HAVE_VDDK
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
@@ -1145,6 +1146,7 @@ TESTS += \
|
||||||
|
test-vddk-password-interactive.sh \
|
||||||
|
test-vddk-real-create.sh \
|
||||||
|
test-vddk-real-dump-plugin.sh \
|
||||||
|
+ test-vddk-real-unaligned-chunk.sh \
|
||||||
|
test-vddk-real.sh \
|
||||||
|
test-vddk-reexec.sh \
|
||||||
|
test-vddk-run.sh \
|
||||||
|
@@ -1177,6 +1179,7 @@ EXTRA_DIST += \
|
||||||
|
test-vddk-password-interactive.sh \
|
||||||
|
test-vddk-real-create.sh \
|
||||||
|
test-vddk-real-dump-plugin.sh \
|
||||||
|
+ test-vddk-real-unaligned-chunk.sh \
|
||||||
|
test-vddk-real.sh \
|
||||||
|
test-vddk-reexec.sh \
|
||||||
|
test-vddk-run.sh \
|
||||||
|
diff --git a/tests/test-vddk-real-unaligned-chunk.sh b/tests/test-vddk-real-unaligned-chunk.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 00000000..28fccd6c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/test-vddk-real-unaligned-chunk.sh
|
||||||
|
@@ -0,0 +1,82 @@
|
||||||
|
+#!/usr/bin/env bash
|
||||||
|
+# 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.
|
||||||
|
+
|
||||||
|
+# Regression test for https://issues.redhat.com/browse/RHEL-71694
|
||||||
|
+
|
||||||
|
+source ./functions.sh
|
||||||
|
+set -e
|
||||||
|
+set -x
|
||||||
|
+
|
||||||
|
+requires_run
|
||||||
|
+requires test "x$vddkdir" != "x"
|
||||||
|
+requires test -d "$vddkdir"
|
||||||
|
+requires test -f "$vddkdir/lib64/libvixDiskLib.so"
|
||||||
|
+requires qemu-img --version
|
||||||
|
+requires_nbdinfo
|
||||||
|
+requires $TRUNCATE --version
|
||||||
|
+requires dd --version
|
||||||
|
+requires test -r /dev/urandom
|
||||||
|
+skip_if_valgrind "because setting LD_LIBRARY_PATH breaks valgrind"
|
||||||
|
+
|
||||||
|
+# VDDK > 5.1.1 only supports x86_64.
|
||||||
|
+if [ `uname -m` != "x86_64" ]; then
|
||||||
|
+ echo "$0: unsupported architecture"
|
||||||
|
+ exit 77
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+d=vddk-real-unaligned-chunk.d
|
||||||
|
+cleanup_fn rm -rf $d
|
||||||
|
+rm -rf $d
|
||||||
|
+mkdir $d
|
||||||
|
+
|
||||||
|
+# Create a vmdk disk which is partially sparse and the size is NOT
|
||||||
|
+# 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
|
||||||
|
+
|
||||||
|
+# Read the map using VDDK.
|
||||||
|
+export d
|
||||||
|
+nbdkit -rfv vddk libdir="$vddkdir" \
|
||||||
|
+ $PWD/$d/test.vmdk \
|
||||||
|
+ --run 'nbdinfo --map "$uri" > $d/map'
|
||||||
|
+cat $d/map
|
||||||
|
+
|
||||||
|
+# Note a few features of the expected map. The first 3 chunks (3*128
|
||||||
|
+# sectors) are allocated, followed by a single hole chunk. Then the
|
||||||
|
+# last 3 unaligned sectors appear allocated (even though they are not)
|
||||||
|
+# because we could not read them using the QueryAllocatedBlocks API so
|
||||||
|
+# we had to assume allocated.
|
||||||
|
+test "$(cat $d/map)" = "\
|
||||||
|
+ 0 196608 0 data
|
||||||
|
+ 196608 65536 3 hole,zero
|
||||||
|
+ 262144 1536 0 data"
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -6,7 +6,7 @@ set -e
|
|||||||
# directory. Use it like this:
|
# directory. Use it like this:
|
||||||
# ./copy-patches.sh
|
# ./copy-patches.sh
|
||||||
|
|
||||||
rhel_version=9.5
|
rhel_version=9.6
|
||||||
|
|
||||||
# Check we're in the right directory.
|
# Check we're in the right directory.
|
||||||
if [ ! -f nbdkit.spec ]; then
|
if [ ! -f nbdkit.spec ]; then
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
-----BEGIN PGP SIGNATURE-----
|
|
||||||
|
|
||||||
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmaTi9oRHHJpY2hAYW5u
|
|
||||||
ZXhpYS5vcmcACgkQkXOPc+G3aKB97w/9H/Ss3V0yhUPgK6bidlCIBmZcUmw0ItTa
|
|
||||||
PoI42QL+lmJCP4FiLd4aAZRfnosTbi/KFfGC5OI/DhZs/bFvLJPX56Dq+tDfLTo8
|
|
||||||
OlpdWkW2E6tALN5ZlA8zFXLfJ+xofpn9/F7O4XdkW04HIpXx4ly8tCPG27idV9UV
|
|
||||||
jjVzwmo/eqhJTWHJAspD1iB/oXfCVh0VVe3d4G/n32/pLfULwK6iEGMze+51IJoI
|
|
||||||
SdKPKtwFmPn5e0r34+JLyCilugJvl3crJI2CZt9Azi31joCgEEif0Mkn2aiY8Zc9
|
|
||||||
S3/3r9US6VriKYYhilLTgpjbimeNZJGuVPqPS8lhaSmAoyOncG1CcKOk2Tewf8m+
|
|
||||||
vrUHFTWKSP6IgdlGnXYZNQprA1zPUePyMpm3RwnaV8N3Vcy0J4lkL80laSQs5VUn
|
|
||||||
PkzwrSxaegWDnrlBjNQi5cWWVSqUMUsEpCQXu93fvbGi/V2wkVlOx5ubPIIo8ykc
|
|
||||||
dPVG3+9d2PUEVXyJLWmA5jXJW19EnZK8fttUrcshbF375CU7Vuo6Ds6QFdcTqEs/
|
|
||||||
te1c3QxDQav4BeV7VbD5xL1xc931F6fWwa9FpzPf366AhCM/tunw91oIUP2bkw8U
|
|
||||||
B7Z83x9nAuxewQeeI+7nDLKdhdg/bpeMoiUUCYQVS1K61+4D+J6bmc2lvsvhj3Pp
|
|
||||||
gMcCwZR9wF0=
|
|
||||||
=SuJ6
|
|
||||||
-----END PGP SIGNATURE-----
|
|
17
SOURCES/nbdkit-1.38.5.tar.gz.sig
Normal file
17
SOURCES/nbdkit-1.38.5.tar.gz.sig
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
|
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmb3vXwRHHJpY2hAYW5u
|
||||||
|
ZXhpYS5vcmcACgkQkXOPc+G3aKD5MQ/+NnAunC2qzgUZFzeTf5gilj/xlk3M7LbA
|
||||||
|
LDtrAMacpq88CvoxKBcvKvW47/loaL9GBxp0rvly7DQ0vm3WaYMIMj9A25vDFqKC
|
||||||
|
IN16/6DDmzMOPkWsDgqAx+VXRMEv/KjtJUxl9jbvZdlmUNGlag/MftVryNqr654w
|
||||||
|
NPDeJnL0jN87/S28LHRhuleVMV9SozSb9iG87S1Z6ipXpHu8MzcXYWWiR4P4eecD
|
||||||
|
0Rbg+HpBQJJnoVtsBBf35V5HEFtpqg4GvCTMQH0lfLsleE1vTi5Yueq4cpE6YVY9
|
||||||
|
Bo5qXUHYy6kVuKcAX6Prvycrh3A847Wh/4M6KfKw4RQgP3FFGMJp+/+M9PzG14gK
|
||||||
|
HtL0moKlS/q78kkpyPvAdKDEpD/U+kSrlv2fwugu403o/XrvLaSzhdWSWBgbaB/0
|
||||||
|
x3pENPe+UIF+VdNikOa2S3hY4mh7/lx2BpTsGN38qFIiK7TZsAY9aAR2z8Er5/O4
|
||||||
|
iubxuPUDsDOTFxCGDS6rxWQKwKVynhEbMzce9R+fKY7XfpRf3RWmplKYyLtAhKbT
|
||||||
|
rQoecPj5fIPpUdWIos8FbiQaC5EeBOEq+ZndTSumyKmkHorSI/VpCRio8DAjXdBd
|
||||||
|
bXDC1CfXSe9VeScTMYFjim8BcFsLexdrJweYANCCURvOG0drgjWxHAlJ+Ou3Beka
|
||||||
|
ygBLbICcbJM=
|
||||||
|
=oY/3
|
||||||
|
-----END PGP SIGNATURE-----
|
@ -55,8 +55,8 @@
|
|||||||
%global source_directory 1.38-stable
|
%global source_directory 1.38-stable
|
||||||
|
|
||||||
Name: nbdkit
|
Name: nbdkit
|
||||||
Version: 1.38.3
|
Version: 1.38.5
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: NBD server
|
Summary: NBD server
|
||||||
|
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
@ -78,15 +78,19 @@ Source2: libguestfs.keyring
|
|||||||
Source3: copy-patches.sh
|
Source3: copy-patches.sh
|
||||||
|
|
||||||
# Patches come from the upstream repository:
|
# Patches come from the upstream repository:
|
||||||
# https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.5/
|
# https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.6/
|
||||||
|
|
||||||
# Patches.
|
# Patches.
|
||||||
Patch0001: 0001-nbdkit-1.38-Fix-inclusion-of-gnutls-socket.h-with-ol.patch
|
Patch0001: 0001-server-log-Move-preserve-errno-to-log_verror-functio.patch
|
||||||
Patch0002: 0002-server-log-Move-preserve-errno-to-log_verror-functio.patch
|
Patch0002: 0002-server-Rename-threadlocal_-set-get-_error-to-._errno.patch
|
||||||
Patch0003: 0003-server-Rename-threadlocal_-set-get-_error-to-._errno.patch
|
Patch0003: 0003-server-Introduce-threadlocal_-set-get-_last_error.patch
|
||||||
Patch0004: 0004-server-Introduce-threadlocal_-set-get-_last_error.patch
|
Patch0004: 0004-server-Take-a-thread-local-copy-of-the-last-call-to-.patch
|
||||||
Patch0005: 0005-server-Take-a-thread-local-copy-of-the-last-call-to-.patch
|
Patch0005: 0005-server-Send-the-last-error-to-the-NBD-client.patch
|
||||||
Patch0006: 0006-server-Send-the-last-error-to-the-NBD-client.patch
|
Patch0006: 0006-vddk-Include-stdbool.h.patch
|
||||||
|
Patch0007: 0007-vddk-Cache-the-disk-size-in-the-handle.patch
|
||||||
|
Patch0008: 0008-vddk-do_extents-Mark-some-local-variables-const.patch
|
||||||
|
Patch0009: 0009-vddk-do_extents-Exit-the-function-if-we-hit-req_one-.patch
|
||||||
|
Patch0010: 0010-vddk-do_extents-Avoid-reading-partial-chunk-beyond-t.patch
|
||||||
|
|
||||||
# For automatic RPM Provides generation.
|
# For automatic RPM Provides generation.
|
||||||
# See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html
|
# See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html
|
||||||
@ -1505,6 +1509,13 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jan 06 2025 Richard W.M. Jones <rjones@redhat.com> - 1.38.5-2
|
||||||
|
- vddk: Avoid reading partial chunk beyond the end of the disk
|
||||||
|
resolves: RHEL-71694
|
||||||
|
|
||||||
|
* Sat Sep 28 2024 Richard W.M. Jones <rjones@redhat.com> - 1.38.5-1
|
||||||
|
- Rebase to 1.38.5 (along stable branch)
|
||||||
|
|
||||||
* Fri Jul 26 2024 Richard W.M. Jones <rjones@redhat.com> - 1.38.3-1
|
* Fri Jul 26 2024 Richard W.M. Jones <rjones@redhat.com> - 1.38.3-1
|
||||||
- Rebase to 1.38.3 (along stable branch)
|
- Rebase to 1.38.3 (along stable branch)
|
||||||
- Send the last error to the NBD client
|
- Send the last error to the NBD client
|
||||||
|
Loading…
Reference in New Issue
Block a user