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?
> >
> > 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. 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.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org