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