virtio: Use started flag in virtio_vmstate_change()
commit7dc7f12297bcee93e0b1974262d18c51cb386e8e
authorXie Yongji <xieyongji@baidu.com>
Wed, 20 Mar 2019 11:26:41 +0000 (20 19:26 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 20 May 2019 22:40:02 +0000 (20 18:40 -0400)
treed85e38cb88af86c9c58e82cf11c3e26c37113c1b
parentbadaf79cfdbd32b22df00bca1a1797036063dc48
virtio: Use started flag in virtio_vmstate_change()

Currently, we use DRIVER_OK status bit to check whether guest
driver has started the device in virtio_vmstate_change(). But it's
not the case for virtio 1.0 transitional devices. If migration completes
between kicking virtqueue and setting VIRTIO_CONFIG_S_DRIVER_OK, guest
may be hung. So here we use started flag to check guest state instead.

Signed-off-by: Xie Yongji <xieyongji@baidu.com>
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Message-Id: <20190320112646.3712-3-xieyongji@baidu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio.c