2021-12-07 10:07:46 +00:00
|
|
|
From 7cd9b2bbbdae01513baa215abfacecbf19af2b1d Mon Sep 17 00:00:00 2001
|
2021-10-29 13:09:21 +00:00
|
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
|
Date: Sat, 23 Oct 2021 16:24:27 +0100
|
|
|
|
Subject: [PATCH] vddk: Add logical and physical sector size to -D
|
|
|
|
vddk.diskinfo output
|
|
|
|
|
|
|
|
In VDDK >= 7 it is possible to display the logical and physical sector
|
|
|
|
size in debug output.
|
|
|
|
|
|
|
|
This commit also extends the test since this flag was not tested
|
|
|
|
before.
|
|
|
|
|
|
|
|
(cherry picked from commit 5bb8f0586e1faabcbf4f43d722a3b3cb5b352e33)
|
|
|
|
---
|
|
|
|
plugins/vddk/vddk.c | 6 ++++++
|
|
|
|
tests/test-vddk-real.sh | 3 ++-
|
|
|
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
|
2021-10-30 13:36:32 +00:00
|
|
|
index d74a484d..50bdde26 100644
|
2021-10-29 13:09:21 +00:00
|
|
|
--- a/plugins/vddk/vddk.c
|
|
|
|
+++ b/plugins/vddk/vddk.c
|
2021-10-30 13:36:32 +00:00
|
|
|
@@ -822,6 +822,12 @@ vddk_get_size (void *handle)
|
2021-10-29 13:09:21 +00:00
|
|
|
info->parentFileNameHint ? : "NULL");
|
|
|
|
nbdkit_debug ("disk info: uuid: %s",
|
|
|
|
info->uuid ? : "NULL");
|
|
|
|
+ if (library_version >= 7) {
|
|
|
|
+ nbdkit_debug ("disk info: sectory size: "
|
|
|
|
+ "logical %" PRIu32 " physical %" PRIu32,
|
|
|
|
+ info->logicalSectorSize,
|
|
|
|
+ info->physicalSectorSize);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
VDDK_CALL_START (VixDiskLib_FreeInfo, "info")
|
|
|
|
diff --git a/tests/test-vddk-real.sh b/tests/test-vddk-real.sh
|
2021-10-30 13:36:32 +00:00
|
|
|
index a6aceac9..ae965245 100755
|
2021-10-29 13:09:21 +00:00
|
|
|
--- a/tests/test-vddk-real.sh
|
|
|
|
+++ b/tests/test-vddk-real.sh
|
2021-10-30 13:36:32 +00:00
|
|
|
@@ -89,7 +89,8 @@ if grep 'cannot open shared object file' $log; then
|
2021-10-29 13:09:21 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Now run nbdkit for the test.
|
|
|
|
-start_nbdkit -P $pid -U $sock -D vddk.stats=1 vddk libdir="$vddkdir" $vmdk
|
|
|
|
+start_nbdkit -P $pid -U $sock -D vddk.stats=1 -D vddk.diskinfo=1 \
|
|
|
|
+ vddk libdir="$vddkdir" $vmdk
|
|
|
|
uri="nbd+unix:///?socket=$sock"
|
|
|
|
|
|
|
|
# VDDK < 6.0 did not support flush, so disable flush test there. Also
|
|
|
|
--
|
|
|
|
2.31.1
|
|
|
|
|