qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Czenczek <hreitz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Michael Roth <michael.roth@amd.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH 2/5] virtio-blk: clarify that there is at least 1 virtqueue
Date: Tue, 6 Feb 2024 16:08:39 +0100	[thread overview]
Message-ID: <fdbc6102-1b9c-4566-9839-092bf48ba6f9@redhat.com> (raw)
In-Reply-To: <20240205172659.476970-3-stefanha@redhat.com>

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

On 05.02.24 18:26, Stefan Hajnoczi wrote:
> It is not possible to instantiate a virtio-blk device with 0 virtqueues.
> The following check is located in ->realize():
>
>    if (!conf->num_queues) {
>        error_setg(errp, "num-queues property must be larger than 0");
>        return;
>    }
>
> Later on we access s->vq_aio_context[0] under the assumption that there
> is as least one virtqueue. Hanna Czenczek<hreitz@redhat.com>  noted that
> it would help to show that the array index is already valid.
>
> Add an assertion to document that s->vq_aio_context[0] is always
> safe...and catch future code changes that break this assumption.
>
> Suggested-by: Hanna Czenczek<hreitz@redhat.com>
> Signed-off-by: Stefan Hajnoczi<stefanha@redhat.com>
> ---
>   hw/block/virtio-blk.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Hanna Czenczek <hreitz@redhat.com>

[-- Attachment #2: Type: text/html, Size: 1513 bytes --]

  parent reply	other threads:[~2024-02-06 15:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 17:26 [PATCH 0/5] virtio-blk: iothread-vq-mapping cleanups Stefan Hajnoczi
2024-02-05 17:26 ` [PATCH 1/5] virtio-blk: enforce iothread-vq-mapping validation Stefan Hajnoczi
2024-02-06  7:29   ` Manos Pitsidianakis
2024-02-06 15:18     ` Stefan Hajnoczi
2024-02-06 15:07   ` Hanna Czenczek
2024-02-05 17:26 ` [PATCH 2/5] virtio-blk: clarify that there is at least 1 virtqueue Stefan Hajnoczi
2024-02-06  7:23   ` Manos Pitsidianakis
2024-02-06 15:08   ` Hanna Czenczek [this message]
2024-02-05 17:26 ` [PATCH 3/5] virtio-blk: add vq_rq[] bounds check in virtio_blk_dma_restart_cb() Stefan Hajnoczi
2024-02-06  7:20   ` Manos Pitsidianakis
2024-02-06 15:09   ` Hanna Czenczek
2024-02-05 17:26 ` [PATCH 4/5] virtio-blk: declare VirtIOBlock::rq with a type Stefan Hajnoczi
2024-02-06  7:16   ` Manos Pitsidianakis
2024-02-06 15:10   ` Hanna Czenczek
2024-02-05 17:26 ` [PATCH 5/5] monitor: use aio_co_reschedule_self() Stefan Hajnoczi
2024-02-06  7:28   ` Manos Pitsidianakis
2024-02-06 15:11   ` Hanna Czenczek
2024-02-07  7:04   ` Markus Armbruster

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=fdbc6102-1b9c-4566-9839-092bf48ba6f9@redhat.com \
    --to=hreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).