On Mon, Jun 01, 2026 at 11:44:03PM +0200, Sam Li wrote:
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index 9cb9f1fb2b..285db19ac7 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -288,6 +288,9 @@ static void virtio_blk_submit_multireq(VirtIOBlock *s, 
> MultiReqBuffer *mrb)
>      int i = 0, start = 0, num_reqs = 0, niov = 0, nb_sectors = 0;
>      uint32_t max_transfer;
>      int64_t sector_num = 0;
> +    BlockDriverState *bs = blk_bs(s->blk);

Please add a blk_get_zone_size() API in block-backend.c along the lines
of the other accessor APIs (blk_get_request_alignment(), etc) instead of
using bs directly.

> +    bool zone_cross;
> +    int64_t zone_sector, end_sector;
>  
>      if (mrb->num_reqs == 1) {
>          submit_requests(s, mrb, 0, 1, -1);
> @@ -303,17 +306,34 @@ static void virtio_blk_submit_multireq(VirtIOBlock *s, 
> MultiReqBuffer *mrb)
>      for (i = 0; i < mrb->num_reqs; i++) {
>          VirtIOBlockReq *req = mrb->reqs[i];
>          if (num_reqs > 0) {
> +            zone_cross = false;
> +
> +            /*
> +             * On zoned backends, a single backend write must not span a zone

This code handles both reads and writes but the comment only mentions
writes. I think reads are allowed to span zones, so should there be a
check that mrb->is_write?

Attachment: signature.asc
Description: PGP signature

Reply via email to