qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Jason Wang <jasowang@redhat.com>,
	qemu-stable@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PULL 3/6] virtio: don't call device on !vm_running
Date: Thu, 11 Sep 2014 14:19:42 +0200	[thread overview]
Message-ID: <5411935E.7020402@de.ibm.com> (raw)
In-Reply-To: <1409848699-28374-4-git-send-email-stefanha@redhat.com>

On 04/09/14 18:38, Stefan Hajnoczi wrote:
> From: "Michael S. Tsirkin" <mst@redhat.com>
> 
> On vm stop, virtio changes vm_running state
> too soon, so callbacks can get envoked with
> vm_running = false;
> 
> Cc: qemu-stable@nongnu.org
> Cc: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  hw/virtio/virtio.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 5c98180..ac22238 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -1108,7 +1108,10 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
>      BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
>      VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
>      bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
> -    vdev->vm_running = running;
> +
> +    if (running) {
> +        vdev->vm_running = running;
> +    }
> 
>      if (backend_run) {
>          virtio_set_status(vdev, vdev->status);
> @@ -1121,6 +1124,10 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
>      if (!backend_run) {
>          virtio_set_status(vdev, vdev->status);
>      }
> +
> +    if (!running) {
> +        vdev->vm_running = running;
> +    }
>  }
> 
>  void virtio_init(VirtIODevice *vdev, const char *name,
> 


This broke managedsave on s390x:
qemu-system-s390x: hw/net/virtio-net.c:1348: virtio_net_save: Assertion `!n->vhost_started' failed.
reverting that commit makes it working again.
Any ideas?

Christian

  reply	other threads:[~2014-09-11 12:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 16:38 [Qemu-devel] [PULL v2 0/6] Net patches Stefan Hajnoczi
2014-09-04 16:38 ` [Qemu-devel] [PULL 1/6] net: Forbid dealing with packets when VM is not running Stefan Hajnoczi
2014-09-04 16:38 ` [Qemu-devel] [PULL 2/6] virtio-net: don't run bh on vm stopped Stefan Hajnoczi
2014-09-04 16:38 ` [Qemu-devel] [PULL 3/6] virtio: don't call device on !vm_running Stefan Hajnoczi
2014-09-11 12:19   ` Christian Borntraeger [this message]
2014-09-11 12:38     ` Michael S. Tsirkin
2014-09-11 12:41       ` Christian Borntraeger
2014-09-04 16:38 ` [Qemu-devel] [PULL 4/6] net: invoke callback when purging queue Stefan Hajnoczi
2014-09-04 16:38 ` [Qemu-devel] [PULL 5/6] net: complete all queued packets on VM stop Stefan Hajnoczi
2014-09-04 16:38 ` [Qemu-devel] [PULL 6/6] virtio-net: purge outstanding packets when starting vhost Stefan Hajnoczi
2014-09-04 17:33 ` [Qemu-devel] [PULL v2 0/6] Net patches Peter Maydell

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=5411935E.7020402@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).