On 06.11.25 01:10, Eric Blake wrote:
On Tue, Nov 04, 2025 at 02:38:22PM +0300, Vladimir Sementsov-Ogievskiy wrote:
On 03.11.25 23:10, Eric Blake wrote:
Test that all images in a qcow2 chain using an NBD backing file can be
served by the same process.  Prior to the recent QIONetListener fixes,
this test would demonstrate deadlock.

The test borrows heavily from the original formula by "John Doe" in
the gitlab bug, but uses a Unix socket rather than TCP to avoid port
contention, and uses a full-blown QEMU rather than qemu-storage-daemon
since both programs were impacted.

[While preparing this patch by making the new test executable, I
noticed vvfat.out does not need execute permissions]

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/3169
Signed-off-by: Eric Blake <[email protected]>
---
   tests/qemu-iotests/tests/nbd-in-qcow2-chain   | 84 +++++++++++++++++++
   .../qemu-iotests/tests/nbd-in-qcow2-chain.out | 56 +++++++++++++
   tests/qemu-iotests/tests/vvfat.out            |  0
   3 files changed, 140 insertions(+)
   create mode 100755 tests/qemu-iotests/tests/nbd-in-qcow2-chain
   create mode 100644 tests/qemu-iotests/tests/nbd-in-qcow2-chain.out
   mode change 100755 => 100644 tests/qemu-iotests/tests/vvfat.out

Should I split out that file mode change to a separate cleanup patch?

Probably. Personally, I don't care.



diff --git a/tests/qemu-iotests/tests/nbd-in-qcow2-chain 
b/tests/qemu-iotests/tests/nbd-in-qcow2-chain
new file mode 100755
index 00000000000..b89f74d4552
--- /dev/null
+++ b/tests/qemu-iotests/tests/nbd-in-qcow2-chain

+echo
+echo "=== Creating wrapper image ==="
+
+_make_test_img -F raw -b "nbd+unix:///base?socket=$SOCK_DIR/nbd" $size
+
+echo
+echo "=== Adding wrapper image ==="
+
+_send_qemu_cmd $QEMU_HANDLE '{"execute": "blockdev-add",
+  "arguments": {"node-name":"wrap", "driver":"qcow2",
+     "file":{"driver":"file", "filename":"'"$TEST_IMG"'"}}}' 'return'

Hmm. Why don't you specify "backing": "base" here?

Because the original bug report didn't either.

Ah, I missed the idea: we setup our qcow2 image, so that backing is a
nbd protocol uri. So "backing": "base" would be wrong

 However, I can see the
wisdom in enhancing the test to cover multiple scenarios: both a
backing chain learned only by what is in the qcow2 file, and an
explicit backing chain where the NBD client is spelled out in the QMP
code.  I'll see if I can enhance that for v2.



Not sure, that it will add real value to the test.. It should be the same
block-graph finally. If you decide keep it as is (or with vvfat fix dropped):

Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>


--
Best regards,
Vladimir

Reply via email to