From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTTeq-0007KA-VT for qemu-devel@nongnu.org; Mon, 15 Sep 2014 06:37:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTTej-0004WD-SH for qemu-devel@nongnu.org; Mon, 15 Sep 2014 06:37:20 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:39310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTTej-0004W3-KH for qemu-devel@nongnu.org; Mon, 15 Sep 2014 06:37:13 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Sep 2014 11:37:10 +0100 Message-ID: <5416C154.6080008@de.ibm.com> Date: Mon, 15 Sep 2014 12:37:08 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1410452301-28533-1-git-send-email-mst@redhat.com> <1410452301-28533-2-git-send-email-mst@redhat.com> In-Reply-To: <1410452301-28533-2-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] Revert "virtio: don't call device on !vm_running" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Jason Wang , qemu-stable@nongnu.org, Anthony Liguori , Dietmar Maurer On 09/11/2014 06:18 PM, Michael S. Tsirkin wrote: > This reverts commit a1bc7b827e422e1ff065640d8ec5347c4aadfcd8. > virtio: don't call device on !vm_running > It turns out that virtio net assumes that vm_running > is updated before device status callback in many places, > so this change leads to asserts. > Previous commit fixes the root issue that motivated > a1bc7b827e422e1ff065640d8ec5347c4aadfcd8 differently, > so there's no longer a need for this change. > > In the future, we might be able to drop checking vm_running > completely, and check vm state directly. > > Reported-by: Dietmar Maurer > Cc: qemu-stable@nongnu.org > Cc: Jason Wang > Signed-off-by: Michael S. Tsirkin Tested-by: Christian Borntraeger > --- > hw/virtio/virtio.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index ac22238..5c98180 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -1108,10 +1108,7 @@ 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); > - > - if (running) { > - vdev->vm_running = running; > - } > + vdev->vm_running = running; > > if (backend_run) { > virtio_set_status(vdev, vdev->status); > @@ -1124,10 +1121,6 @@ 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, >