Linux virtualization list
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Weimin Xiong <xiongwm2026@163.com>
Cc: qemu-devel@nongnu.org, jasowang@redhat.com,
	virtualization@lists.linux.dev,
	Xiong Weimin <xiongweimin@kylinos.cn>
Subject: Re: [PATCH 3/3] hw/virtio: Add error handling for vhost_virtqueue_mask failure
Date: Fri, 24 Jul 2026 05:51:46 -0400	[thread overview]
Message-ID: <20260724054836-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260724093759.810108-2-xiongwm2026@163.com>

On Fri, Jul 24, 2026 at 05:37:59PM +0800, Weimin Xiong wrote:
> From: Xiong Weimin <xiongweimin@kylinos.cn>
> 
> In vhost_virtqueue_start(), the call to vhost_virtqueue_mask() has a
> TODO comment indicating errors are not handled. Add proper error
> checking and propagate errors to the caller.
> 
> Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>

why is this part of this patchset?

> ---
>  hw/virtio/vhost.c | 10 +++++++--
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 1234567890ab..fedcba098765 4321006
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -1467,9 +1467,13 @@ static int vhost_virtqueue_start(struct VirtIODevice *vdev,
>       * will do it later.
>       */
>      if (!vdev->use_guest_notifier_mask) {
> -        /* TODO: check and handle errors. */
> -        vhost_virtqueue_mask(dev, vdev, idx, false);
> +        int r = vhost_virtqueue_mask(dev, vdev, idx, false);
> +        if (r < 0) {
> +            VHOST_OPS_DEBUG(r, "vhost_virtqueue_mask failed");
> +            r = -1;
> +            goto fail;
> +        }


and then what happens?

>      }
>  
>      if (k->query_guest_notifiers &&


  reply	other threads:[~2026-07-24  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  9:37 [PATCH 2/3] hw/virtio: Implement vhost_log_start and vhost_log_stop Weimin Xiong
2026-07-24  9:37 ` [PATCH 3/3] hw/virtio: Add error handling for vhost_virtqueue_mask failure Weimin Xiong
2026-07-24  9:51   ` Michael S. Tsirkin [this message]
2026-07-24  9:48 ` [PATCH 2/3] hw/virtio: Implement vhost_log_start and vhost_log_stop Michael S. Tsirkin

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=20260724054836-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=virtualization@lists.linux.dev \
    --cc=xiongweimin@kylinos.cn \
    --cc=xiongwm2026@163.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