53 lines
1.8 KiB
Diff
53 lines
1.8 KiB
Diff
|
From b4a6854a45eed920ed6631c8c38e979b95a52470 Mon Sep 17 00:00:00 2001
|
||
|
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
|
||
|
index 14e7ada9..290a99a8 100644
|
||
|
--- a/plugins/vddk/vddk.c
|
||
|
+++ b/plugins/vddk/vddk.c
|
||
|
@@ -823,6 +823,12 @@ vddk_get_size (void *handle)
|
||
|
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
|
||
|
index 08f6f8d8..b5f85067 100755
|
||
|
--- a/tests/test-vddk-real.sh
|
||
|
+++ b/tests/test-vddk-real.sh
|
||
|
@@ -82,7 +82,8 @@ if grep 'cannot open shared object file' test-vddk-real.log; then
|
||
|
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
|
||
|
|