qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Alberto Faria <afaria@redhat.com>
Cc: qemu-devel@nongnu.org, "Stefano Garzarella" <sgarzare@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Xie Yongji" <xieyongji@bytedance.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Raphael Norwitz" <raphael@enfabrica.net>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	qemu-block@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Zhao Liu" <zhao1.liu@intel.com>, "Coiby Xu" <Coiby.Xu@gmail.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Yanan Wang" <wangyanan55@huawei.com>
Subject: Re: [RFC v2 2/4] virtio-blk: Add VIRTIO_BLK_T_OUT_FUA command support
Date: Mon, 12 May 2025 15:32:53 -0400	[thread overview]
Message-ID: <20250512193253.GL141177@fedora> (raw)
In-Reply-To: <20250508162044.857655-3-afaria@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]

On Thu, May 08, 2025 at 05:20:42PM +0100, Alberto Faria wrote:
> @@ -828,13 +832,16 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
>  
>      type = virtio_ldl_p(vdev, &req->out.type);
>  
> -    /* VIRTIO_BLK_T_OUT defines the command direction. VIRTIO_BLK_T_BARRIER
> -     * is an optional flag. Although a guest should not send this flag if
> -     * not negotiated we ignored it in the past. So keep ignoring it. */
> -    switch (type & ~(VIRTIO_BLK_T_OUT | VIRTIO_BLK_T_BARRIER)) {
> +    /* VIRTIO_BLK_T_BARRIER is an optional flag. Although a guest should not
> +     * send this flag if not negotiated we ignored it in the past. So keep
> +     * ignoring it. */
> +    switch (type & ~VIRTIO_BLK_T_BARRIER) {

This changes the behavior of the device. VIRTIO_BLK_T_FLUSH |
VIRTIO_BLK_T_OUT is now treated as an unsupported command instead of a
flush. The same is true for the other command types as well (like zoned
devices, discard, etc).

Buggy guest drivers might depend on this behavior. From a user
perspective it's QEMU's fault if existing guests break, even if the
guest driver violates the VIRTIO specification. I would treat this as a
stable ABI that third-party virtio-blk drivers depend on unless there is
a strong reason to change existing behavior.

Can you add "case VIRTIO_BLK_T_OUT_FUA & ~VIRTIO_BLK_T_OUT:" instead of
changing existing behavior?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-05-12 19:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08 16:20 [RFC v2 0/4] virtio-blk: Add support for FUA write requests Alberto Faria
2025-05-08 16:20 ` [RFC v2 1/4] include: Add tentative virtio-blk FUA write definitions Alberto Faria
2025-05-12 19:12   ` Stefan Hajnoczi
2025-05-08 16:20 ` [RFC v2 2/4] virtio-blk: Add VIRTIO_BLK_T_OUT_FUA command support Alberto Faria
2025-05-12 19:32   ` Stefan Hajnoczi [this message]
2025-05-08 16:20 ` [RFC v2 3/4] vhost-user-blk: " Alberto Faria
2025-05-12 19:43   ` Stefan Hajnoczi
2025-05-08 16:20 ` [RFC v2 4/4] vduse-blk: " Alberto Faria
2025-05-12 19:52   ` Stefan Hajnoczi
2025-05-12 19:52   ` Stefan Hajnoczi

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=20250512193253.GL141177@fedora \
    --to=stefanha@redhat.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=afaria@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael@enfabrica.net \
    --cc=sgarzare@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=xieyongji@bytedance.com \
    --cc=zhao1.liu@intel.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;
as well as URLs for NNTP newsgroup(s).