* [PATCH] block/blkio: use FUA flag on write zeroes only if supported
@ 2024-08-08 8:05 Stefano Garzarella
2024-08-08 15:53 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stefano Garzarella @ 2024-08-08 8:05 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-block, Paolo Bonzini, Philippe Mathieu-Daudé,
Hanna Reitz, Thomas Huth, Daniel P. Berrangé,
Marc-André Lureau, Stefan Hajnoczi, Kevin Wolf,
Stefano Garzarella, qemu-stable
libblkio supports BLKIO_REQ_FUA with write zeros requests only since
version 1.4.0, so let's inform the block layer that the blkio driver
supports it only in this case. Otherwise we can have runtime errors
as reported in https://issues.redhat.com/browse/RHEL-32878
Fixes: fd66dbd424 ("blkio: add libblkio block driver")
Cc: qemu-stable@nongnu.org
Buglink: https://issues.redhat.com/browse/RHEL-32878
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
meson.build | 2 ++
block/blkio.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index c2a050b844..81ecd4bae7 100644
--- a/meson.build
+++ b/meson.build
@@ -2305,6 +2305,8 @@ config_host_data.set('CONFIG_BLKIO', blkio.found())
if blkio.found()
config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD',
blkio.version().version_compare('>=1.3.0'))
+ config_host_data.set('CONFIG_BLKIO_WRITE_ZEROS_FUA',
+ blkio.version().version_compare('>=1.4.0'))
endif
config_host_data.set('CONFIG_CURL', curl.found())
config_host_data.set('CONFIG_CURSES', curses.found())
diff --git a/block/blkio.c b/block/blkio.c
index 3d9a2e764c..e0e765af63 100644
--- a/block/blkio.c
+++ b/block/blkio.c
@@ -899,8 +899,10 @@ static int blkio_open(BlockDriverState *bs, QDict *options, int flags,
}
bs->supported_write_flags = BDRV_REQ_FUA | BDRV_REQ_REGISTERED_BUF;
- bs->supported_zero_flags = BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP |
- BDRV_REQ_NO_FALLBACK;
+ bs->supported_zero_flags = BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK;
+#ifdef CONFIG_BLKIO_WRITE_ZEROS_FUA
+ bs->supported_zero_flags |= BDRV_REQ_FUA;
+#endif
qemu_mutex_init(&s->blkio_lock);
qemu_co_mutex_init(&s->bounce_lock);
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block/blkio: use FUA flag on write zeroes only if supported
2024-08-08 8:05 [PATCH] block/blkio: use FUA flag on write zeroes only if supported Stefano Garzarella
@ 2024-08-08 15:53 ` Eric Blake
2024-08-08 17:04 ` Philippe Mathieu-Daudé
2024-08-12 15:41 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2024-08-08 15:53 UTC (permalink / raw)
To: Stefano Garzarella
Cc: qemu-devel, qemu-block, Paolo Bonzini,
Philippe Mathieu-Daudé, Hanna Reitz, Thomas Huth,
Daniel P. Berrangé, Marc-André Lureau, Stefan Hajnoczi,
Kevin Wolf, qemu-stable
On Thu, Aug 08, 2024 at 10:05:45AM GMT, Stefano Garzarella wrote:
> libblkio supports BLKIO_REQ_FUA with write zeros requests only since
> version 1.4.0, so let's inform the block layer that the blkio driver
> supports it only in this case. Otherwise we can have runtime errors
> as reported in https://issues.redhat.com/browse/RHEL-32878
>
> Fixes: fd66dbd424 ("blkio: add libblkio block driver")
> Cc: qemu-stable@nongnu.org
> Buglink: https://issues.redhat.com/browse/RHEL-32878
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> meson.build | 2 ++
> block/blkio.c | 6 ++++--
> 2 files changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block/blkio: use FUA flag on write zeroes only if supported
2024-08-08 8:05 [PATCH] block/blkio: use FUA flag on write zeroes only if supported Stefano Garzarella
2024-08-08 15:53 ` Eric Blake
@ 2024-08-08 17:04 ` Philippe Mathieu-Daudé
2024-08-12 15:41 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-08-08 17:04 UTC (permalink / raw)
To: Stefano Garzarella, qemu-devel
Cc: qemu-block, Paolo Bonzini, Hanna Reitz, Thomas Huth,
Daniel P. Berrangé, Marc-André Lureau, Stefan Hajnoczi,
Kevin Wolf, qemu-stable
On 8/8/24 10:05, Stefano Garzarella wrote:
> libblkio supports BLKIO_REQ_FUA with write zeros requests only since
> version 1.4.0, so let's inform the block layer that the blkio driver
> supports it only in this case. Otherwise we can have runtime errors
> as reported in https://issues.redhat.com/browse/RHEL-32878
>
> Fixes: fd66dbd424 ("blkio: add libblkio block driver")
> Cc: qemu-stable@nongnu.org
> Buglink: https://issues.redhat.com/browse/RHEL-32878
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> meson.build | 2 ++
> block/blkio.c | 6 ++++--
> 2 files changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block/blkio: use FUA flag on write zeroes only if supported
2024-08-08 8:05 [PATCH] block/blkio: use FUA flag on write zeroes only if supported Stefano Garzarella
2024-08-08 15:53 ` Eric Blake
2024-08-08 17:04 ` Philippe Mathieu-Daudé
@ 2024-08-12 15:41 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2024-08-12 15:41 UTC (permalink / raw)
To: Stefano Garzarella
Cc: qemu-devel, qemu-block, Paolo Bonzini,
Philippe Mathieu-Daudé, Hanna Reitz, Thomas Huth,
Daniel P. Berrangé, Marc-André Lureau, Kevin Wolf,
qemu-stable
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
On Thu, Aug 08, 2024 at 10:05:45AM +0200, Stefano Garzarella wrote:
> libblkio supports BLKIO_REQ_FUA with write zeros requests only since
> version 1.4.0, so let's inform the block layer that the blkio driver
> supports it only in this case. Otherwise we can have runtime errors
> as reported in https://issues.redhat.com/browse/RHEL-32878
>
> Fixes: fd66dbd424 ("blkio: add libblkio block driver")
> Cc: qemu-stable@nongnu.org
> Buglink: https://issues.redhat.com/browse/RHEL-32878
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> meson.build | 2 ++
> block/blkio.c | 6 ++++--
> 2 files changed, 6 insertions(+), 2 deletions(-)
Thanks, applied to my block tree:
https://gitlab.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-12 15:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08 8:05 [PATCH] block/blkio: use FUA flag on write zeroes only if supported Stefano Garzarella
2024-08-08 15:53 ` Eric Blake
2024-08-08 17:04 ` Philippe Mathieu-Daudé
2024-08-12 15:41 ` Stefan Hajnoczi
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.