All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: andrey.drobyshev@virtuozzo.com
Cc: svt-core@virtuozzo.com, den@openvz.org
Subject: [PATCH hci-8.1 0/1] virtio-scsi: fix hot-plugged disk invisible in the guest #VSTOR-151351
Date: Mon, 26 Oct 2026 12:11:33 +0100	[thread overview]
Message-ID: <20261026111134.145823-1-den@openvz.org> (raw)

A disk or CD-ROM hot-plugged into virtio-scsi sometimes never shows up
in the guest until the bus is rescanned by hand. CI hits it with Windows
Server guests (vioscsi) and with Linux guests, always with the controller
on an iothread: VSTOR-151351, VSTOR-147722, VSTOR-150741 and the Linux
tickets VSTOR-146483, 146499, 146614 and 147072.

The RESCAN event is pushed from the plug() callback, before the device
is realized, and the iothread request path does not see unrealized
devices. A guest that scans right away gets BAD_TARGET and does not
retry. The patch moves the event to a main-loop bottom half. Ilya Rudakov
found the cause.

This is the patch posted to qemu-devel on 2026-10-23, not yet merged:
https://lore.kernel.org/qemu-devel/20261023162000.2796947-1-den@openvz.org/
The only difference is the non-const HotplugHandler argument of
virtio_scsi_hotplug() in our tree.

There is no test in the patch: a qtest or iotests client is served by
the main loop and cannot get a request into the window inside
device_add. On the upstream build, a Linux guest with the main thread
stalled for 3 s in scsi_bus_set_ua() under gdb missed the hot-plugged
LUN in 3 of 3 runs without the fix and saw it in 3 of 3 with it. On this
tree, hw/scsi/virtio-scsi.c only has been build-checked.

Signed-off-by: Denis V. Lunev <den@openvz.org>

Denis V. Lunev (1):
  virtio-scsi: fix hot-plug event racing device realize #VSTOR-151351

 hw/scsi/virtio-scsi.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)


base-commit: f3c1d9ef263edfab8d2a273078493bb766dcf8f8
-- 
2.53.0


             reply	other threads:[~2026-10-26 11:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 11:11 Denis V. Lunev [this message]
2026-10-26 11:11 ` [PATCH hci-8.1 1/1] virtio-scsi: fix hot-plug event racing device realize #VSTOR-151351 Denis V. Lunev
2026-10-26 11:14   ` no-reply
2026-10-26 11:29   ` Andrey Drobyshev
  -- strict thread matches above, loose matches on Subject: below --
2026-10-26 11:11 [PATCH hci-8.1 0/1] virtio-scsi: fix hot-plugged disk invisible in the guest #VSTOR-151351 Denis V. Lunev

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=20261026111134.145823-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.drobyshev@virtuozzo.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.