From: "Michael S. Tsirkin" <mst@redhat.com>
To: Anton Kuchin <antonkuchin@yandex-team.ru>
Cc: qemu-devel@nongnu.org, yc-core@yandex-team.ru
Subject: Re: [RFC PATCH] virtio: Change order of appling runstate to device and bus
Date: Mon, 6 Jan 2020 07:43:43 -0500 [thread overview]
Message-ID: <20200106074302-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20191220125245.7679-1-antonkuchin@yandex-team.ru>
On Fri, Dec 20, 2019 at 03:52:45PM +0300, Anton Kuchin wrote:
> On transition to running first apply state to bus and then to device
> so device can access bus functions correctly. When going to stopped
> notify device first and then the bus.
>
> Signed-off-by: Anton Kuchin <antonkuchin@yandex-team.ru>
I kind of like this but this has the potential to break lots of things.
How was this tested?
> ---
> hw/virtio/virtio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 04716b5f6c..2ea2edba10 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -3096,7 +3096,7 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
> bool backend_run = running && virtio_device_started(vdev, vdev->status);
> vdev->vm_running = running;
>
> - if (backend_run) {
> + if (!backend_run) {
> virtio_set_status(vdev, vdev->status);
> }
>
> @@ -3104,7 +3104,7 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
> k->vmstate_change(qbus->parent, backend_run);
> }
>
> - if (!backend_run) {
> + if (backend_run) {
> virtio_set_status(vdev, vdev->status);
> }
> }
> --
> 2.20.1
prev parent reply other threads:[~2020-01-06 12:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-20 12:52 [RFC PATCH] virtio: Change order of appling runstate to device and bus Anton Kuchin
2020-01-06 12:43 ` Michael S. Tsirkin [this message]
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=20200106074302-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=antonkuchin@yandex-team.ru \
--cc=qemu-devel@nongnu.org \
--cc=yc-core@yandex-team.ru \
/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).