From: Cornelia Huck <cohuck@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, thuth@redhat.com
Subject: Re: [PATCH 3/4] virtio: stop ioeventfd on reset
Date: Thu, 09 Jun 2022 13:56:56 +0200 [thread overview]
Message-ID: <87leu69hiv.fsf@redhat.com> (raw)
In-Reply-To: <20220609091534.1416909-4-pbonzini@redhat.com>
On Thu, Jun 09 2022, Paolo Bonzini <pbonzini@redhat.com> wrote:
> All calls to virtio_bus_reset are preceded by virtio_bus_stop_ioeventfd,
> move the call in virtio_bus_reset: that makes sense and clarifies
> that the vdc->reset function is called with ioeventfd already stopped.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> hw/s390x/virtio-ccw.c | 1 -
> hw/virtio/virtio-bus.c | 1 +
> hw/virtio/virtio-mmio.c | 4 +---
> hw/virtio/virtio-pci.c | 1 -
> 4 files changed, 2 insertions(+), 5 deletions(-)
>
(...)
> diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
> index d7ec023adf..896feb37a1 100644
> --- a/hw/virtio/virtio-bus.c
> +++ b/hw/virtio/virtio-bus.c
> @@ -104,6 +104,7 @@ void virtio_bus_reset(VirtioBusState *bus)
> VirtIODevice *vdev = virtio_bus_get_device(bus);
>
> DPRINTF("%s: reset device.\n", BUS(bus)->name);
> + virtio_bus_stop_ioeventfd(bus);
> if (vdev != NULL) {
> virtio_reset(vdev);
I looked at the code and I'm wondering under which conditions we could
arrive here with vdev == NULL... virtio_bus_stop_ioeventfd() assumes
that a vdev is there, at least if the ioeventfd has been started.
The patch looks correct, though.
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
next prev parent reply other threads:[~2022-06-09 14:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 9:15 [PATCH 0/4] virtio: various cleanups to reset code Paolo Bonzini
2022-06-09 9:15 ` [PATCH 1/4] s390x: simplify virtio_ccw_reset_virtio Paolo Bonzini
2022-06-09 11:40 ` Cornelia Huck
2022-06-09 9:15 ` [PATCH 2/4] virtio-mmio: stop ioeventfd on legacy reset Paolo Bonzini
2022-06-09 11:49 ` Cornelia Huck
2022-06-09 9:15 ` [PATCH 3/4] virtio: stop ioeventfd on reset Paolo Bonzini
2022-06-09 11:56 ` Cornelia Huck [this message]
2022-06-09 9:15 ` [PATCH 4/4] virtio-mmio: cleanup reset Paolo Bonzini
2022-06-09 12:22 ` Cornelia Huck
2022-06-09 14:44 ` Paolo Bonzini
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=87leu69hiv.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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).