From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: andrey.zhadchenko@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com
Subject: [PATCH hci-8.2 v4 0/5] vhost-blk: support the werror/rerror policies
Date: Tue, 1 Dec 2026 10:18:13 +0100 [thread overview]
Message-ID: <20261201091818.1894308-1-alexander.ivanov@virtuozzo.com> (raw)
A vhost-blk disk completes requests to the guest from the kernel, so
QEMU never sees an I/O error and the werror/rerror policies cannot
work the usual way. vhost-blk in the Virtuozzo kernel can hold a
request failed with ENOSPC instead of completing it and signal an
eventfd. This series makes QEMU accept the policies, pause the VM on
a held request and resubmit it on resume or after a migration.
Patch 1 adds the UAPI of the held requests.
Patch 2 adds the werror and rerror properties, which libvirt passes
when the disk has error_policy or rerror_policy set. Without them
QEMU refuses to start such a VM.
Patch 3 stops vhost on every VM stop, not only on pause and at the
end of a migration. Otherwise the device state saved in the other
stopped states is stale, and so is the list of held requests.
Patch 4 sets the hold policy in the kernel, stops the VM with the
io-error reason and a BLOCK_IO_ERROR event on a held request, and
resubmits the held requests on the next start.
Patch 5 migrates the vq and head of each held request, so the
destination resubmits them.
v4:
- patch 2, 5: add Reviewed-by
- patch 3: add the Fixes tag
- no code changes
v3:
- hold the requests in vhost-blk instead of dm-qcow2: the IO_ERROR
uevent is replaced with an eventfd, and the held requests are
resubmitted with an ioctl
- new patch 1: the UAPI of the held requests
- new patch 3: stop vhost on every VM stop
- patch 4 replaces "pause the VM on an IO_ERROR uevent from dm-qcow2"
- new patch 5: migrate the held requests instead of blocking
migration and savevm
- patch 2: update the commit message, the code is unchanged
v2:
- patch 1: accept enospc as rerror, add Reviewed-by
- patch 2: stop the VM even if the event does not match the policy of
the device, with a warning, as nobody resubmits the held request
otherwise
- patch 2: ignore repeated events once the held request is reported,
as the run state stays running until the main loop handles the stop
- patch 2: if the VM is already stopped, block migration and emit
BLOCK_IO_ERROR without requesting a stop
- patch 2: ignore the event while vhost is stopped and in the
suspended state
- patch 2: accept enospc without ueventfd, as it is the default
The series applies on top of "vhost-blk: support discard". On a
kernel without the held request ioctls QEMU warns and runs as before.
https://virtuozzo.atlassian.net/browse/VSTOR-152175
Alexander Ivanov (5):
linux-headers: add the vhost-blk held request ioctls #VSTOR-152175
vhost-blk: add the werror and rerror properties #VSTOR-152175
vhost-blk: stop vhost on every VM stop #VSTOR-152175
vhost-blk: pause the VM on a request failed with ENOSPC #VSTOR-152175
vhost-blk: migrate the held requests #VSTOR-152175
hw/block/vhost-blk.c | 275 ++++++++++++++++++-
include/hw/virtio/vhost-blk.h | 9 +
include/standard-headers/linux/vhost_types.h | 18 ++
linux-headers/linux/vhost.h | 31 +++
4 files changed, 329 insertions(+), 4 deletions(-)
--
2.53.0
next reply other threads:[~2026-12-01 9:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 9:18 Alexander Ivanov [this message]
2026-12-01 9:18 ` [PATCH hci-8.2 v4 1/5] linux-headers: add the vhost-blk held request ioctls #VSTOR-152175 Alexander Ivanov
2026-12-01 9:21 ` no-reply
2026-12-01 9:18 ` [PATCH hci-8.2 v4 2/5] vhost-blk: add the werror and rerror properties #VSTOR-152175 Alexander Ivanov
2026-12-01 9:18 ` [PATCH hci-8.2 v4 3/5] vhost-blk: stop vhost on every VM stop #VSTOR-152175 Alexander Ivanov
2026-12-01 9:24 ` no-reply
2026-12-01 9:18 ` [PATCH hci-8.2 v4 4/5] vhost-blk: pause the VM on a request failed with ENOSPC #VSTOR-152175 Alexander Ivanov
2026-12-01 9:25 ` no-reply
2026-12-01 9:41 ` Alexander Ivanov
2026-12-01 9:18 ` [PATCH hci-8.2 v4 5/5] vhost-blk: migrate the held requests #VSTOR-152175 Alexander Ivanov
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=20261201091818.1894308-1-alexander.ivanov@virtuozzo.com \
--to=alexander.ivanov@virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=andrey.zhadchenko@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.