From: no-reply@sashiko.virtuozzo.com
To: andrey.drobyshev@virtuozzo.com, "Denis V. Lunev" <den@openvz.org>
Cc: svt-core@virtuozzo.com, den@openvz.org
Subject: Re: [PATCH hci-dev 4/6] tests/qtest/virtio-scsi: cover a replacement that changes the size #VSTOR-130961
Date: Wed, 4 Nov 2026 13:54:00 +0000 [thread overview]
Message-ID: <010701a1a6d68b4c-236ac450-e237-46bb-83e3-8cbb3487e67d-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261104134539.1519657-5-den@openvz.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] qtest: replaced-node tests never check equal-size or multi-parent notification
--
Subject: Re: [PATCH] tests/qtest/virtio-scsi: cover a replacement that changes the size #VSTOR-130961
commit dfa745e49f7f99a718150defda33d68b4cb092a9
Author: Denis V. Lunev <den@openvz.org>
tests/qtest/virtio-scsi: cover a replacement that changes the size #VSTOR-130961
This adds a qtest that realizes a scsi-hd on a 1 MiB null-co node, replaces
it with a 128 MiB node via qom-set, and checks for the CAPACITY DATA HAS
CHANGED unit attention followed by a successful read that only fits in the
new node.
Message-ID: <20260812121500.1034178-4-den@openvz.org>
> diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c
> --- a/tests/qtest/virtio-scsi-test.c
> +++ b/tests/qtest/virtio-scsi-test.c
[ ... ]
> +/* Test replacing the backing node with one of a different size */
> +static void test_replaced_node_size(void *obj, void *data,
> + QGuestAllocator *t_alloc)
> +{
[ ... ]
> + /* Swap in a 128 MiB node; the device is not reset by this */
> + qtest_qmp_assert_success(global_qtest,
> + "{'execute': 'qom-set', 'arguments': {"
> + " 'path': '/machine/peripheral/scsi-hd0',"
> + " 'property': 'drive', 'value': 'big'}}");
[Severity: Low]
This isn't a bug, but is the coverage here complete enough?
test_replaced_node_size() only exercises a size-changing replacement
(small at 1 MiB to big at 128 MiB) with a single parent, scsi-hd0.
The notification is issued from bdrv_replace_resize_commit() in block.c:
if (old_len >= 0 && new_len >= 0 && new_len != old_len) {
bdrv_parent_cb_resize(s->new_bs);
}
Would this test still pass if the new_len != old_len check were dropped?
An equal-size replacement would then send a spurious capacity-changed unit
attention, and nothing here would catch it.
Also, bdrv_parent_cb_resize() goes through bdrv_co_parent_cb_resize(),
which notifies every parent of new_bs, not only the replaced child. Would
it be worth adding a case where new_bs has a second parent, to check that
behaviour?
Looking at the final state of the series, the later patches only add
further size-changing replacements (node4 at 2 MiB in the qom-set-drive
iotest, and the huge node via vz-x-blockdev-replace). I did not see an
equal-size case or a multi-parent case added anywhere in the series.
[ ... ]
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261104134539.1519657-1-den@openvz.org?part=4
next prev parent reply other threads:[~2026-11-04 13:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 13:45 [PATCH hci-dev 0/6] block, scsi-disk: honour a size change on child replacement #VSTOR-130961 Denis V. Lunev
2026-11-04 13:45 ` [PATCH hci-dev 1/6] block: make bdrv_co_parent_cb_resize() a proper IO API function #VSTOR-130961 Denis V. Lunev
2026-11-04 13:47 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 2/6] block: notify the parent when a replaced child has a different size #VSTOR-130961 Denis V. Lunev
2026-11-04 13:51 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 3/6] scsi-disk: refresh the cached capacity from the resize callback #VSTOR-130961 Denis V. Lunev
2026-11-04 13:50 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 4/6] tests/qtest/virtio-scsi: cover a replacement that changes the size #VSTOR-130961 Denis V. Lunev
2026-11-04 13:54 ` no-reply [this message]
2026-11-04 13:45 ` [PATCH hci-dev 5/6] tests/qemu-iotests/qom-set-drive: replace with a differently sized node #VSTOR-130961 Denis V. Lunev
2026-11-04 13:51 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 6/6] tests/qtest/virtio-scsi: cover vz-x-blockdev-replace changing the size #VSTOR-130961 Denis V. Lunev
2026-11-04 13:53 ` no-reply
2026-11-04 14:00 ` [PATCH hci-dev 0/6] block, scsi-disk: honour a size change on child replacement #VSTOR-130961 Andrey Drobyshev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=010701a1a6d68b4c-236ac450-e237-46bb-83e3-8cbb3487e67d-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=den@openvz.org \
--cc=svt-core@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox