From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>,
andrey.zhadchenko@virtuozzo.com
Cc: svt-core@virtuozzo.com
Subject: Re: [PATCH hci-8.1 1/2] vhost-blk: add the werror and rerror properties #VSTOR-152175
Date: Tue, 17 Nov 2026 20:12:17 +0200 [thread overview]
Message-ID: <bd58e2bb-b121-416e-bddc-77981a1211b3@virtuozzo.com> (raw)
In-Reply-To: <20261117105003.3082044-2-alexander.ivanov@virtuozzo.com>
On 11/17/26 12:50 PM, Alexander Ivanov wrote:
> libvirt passes werror and rerror to the device when the disk has
> error_policy or rerror_policy set, and QEMU refuses to start such a VM
> with vhost-blk.
>
> Accept them with the defaults of other block devices: enospc for
> writes and report for reads. dm-qcow2 holds the failed requests under
> the same policy, which libvirt loads into its table. It has no ignore
> policy, and enospc makes no sense for reads, so reject both.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-152175
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
> ---
> hw/block/vhost-blk.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c
> index abddff02c6d..354111a1b41 100644
> --- a/hw/block/vhost-blk.c
> +++ b/hw/block/vhost-blk.c
> @@ -617,6 +617,24 @@ static void vhost_blk_device_realize(DeviceState *dev, Error **errp)
> return;
> }
>
> + if (conf->conf.werror == BLOCKDEV_ON_ERROR_AUTO) {
> + conf->conf.werror = BLOCKDEV_ON_ERROR_ENOSPC;
> + }
> + if (conf->conf.rerror == BLOCKDEV_ON_ERROR_AUTO) {
> + conf->conf.rerror = BLOCKDEV_ON_ERROR_REPORT;
> + }
> +
> + if (conf->conf.werror == BLOCKDEV_ON_ERROR_IGNORE ||
> + conf->conf.rerror == BLOCKDEV_ON_ERROR_IGNORE) {
> + error_setg(errp, "vhost-blk: 'ignore' error policy is not supported");
> + return;
> + }
> +
> + if (conf->conf.rerror == BLOCKDEV_ON_ERROR_ENOSPC) {
> + error_setg(errp, "vhost-blk: 'enospc' is not supported as rerror");
> + return;
> + }
AFAICT this last if condition is dead code since XML parser in libvirt
currently refuses rerror_policy='enospace'. Correct me if I'm wrong.
Otherwise LGTM.
Reviewed-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
next prev parent reply other threads:[~2026-11-17 18:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 10:50 [PATCH hci-8.1 0/2] vhost-blk: support the werror/rerror policies Alexander Ivanov
2026-11-17 10:50 ` [PATCH hci-8.1 1/2] vhost-blk: add the werror and rerror properties #VSTOR-152175 Alexander Ivanov
2026-11-17 11:03 ` no-reply
2026-11-17 18:12 ` Andrey Drobyshev [this message]
2026-11-17 10:50 ` [PATCH hci-8.1 2/2] vhost-blk: pause the VM on an IO_ERROR uevent from dm-qcow2 #VSTOR-152175 Alexander Ivanov
2026-11-17 11:05 ` no-reply
2026-11-17 18:12 ` Andrey Drobyshev
2026-11-17 10:59 ` [PATCH hci-8.1 0/2] vhost-blk: support the werror/rerror policies Andrey Drobyshev
2026-11-17 18:14 ` 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=bd58e2bb-b121-416e-bddc-77981a1211b3@virtuozzo.com \
--to=andrey.drobyshev@virtuozzo.com \
--cc=alexander.ivanov@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.