From: Stefan Hajnoczi <stefanha@redhat.com>
To: Hanna Czenczek <hreitz@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v2 1/2] virtio: Allow .get_vhost() without vhost_started
Date: Tue, 30 Jul 2024 12:53:45 -0400 [thread overview]
Message-ID: <20240730165345.GA650820@fedora.redhat.com> (raw)
In-Reply-To: <20240723163941.48775-2-hreitz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]
On Tue, Jul 23, 2024 at 06:39:39PM +0200, Hanna Czenczek wrote:
> Historically, .get_vhost() was probably only called when
> vdev->vhost_started is true. However, we now decidedly want to call it
> also when vhost_started is false, specifically so we can issue a reset
> to the vhost back-end while device operation is stopped.
>
> Some .get_vhost() implementations dereference some pointers (or return
> offsets from them) that are probably guaranteed to be non-NULL when
> vhost_started is true, but not necessarily otherwise. This patch makes
> all such implementations check all such pointers, returning NULL if any
> is NULL.
>
> Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
> ---
> include/hw/virtio/virtio.h | 1 +
> hw/display/vhost-user-gpu.c | 2 +-
> hw/net/virtio-net.c | 19 +++++++++++++++++--
> hw/virtio/virtio-crypto.c | 18 +++++++++++++++---
> 4 files changed, 34 insertions(+), 6 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2024-08-01 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 16:39 [PATCH v2 0/2] virtio: Always reset vhost devices Hanna Czenczek
2024-07-23 16:39 ` [PATCH v2 1/2] virtio: Allow .get_vhost() without vhost_started Hanna Czenczek
2024-07-30 16:53 ` Stefan Hajnoczi [this message]
2024-07-23 16:39 ` [PATCH v2 2/2] virtio: Always reset vhost devices Hanna Czenczek
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=20240730165345.GA650820@fedora.redhat.com \
--to=stefanha@redhat.com \
--cc=hreitz@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).