diff options
author | Xie Yongji <xieyongji@baidu.com> | 2019-03-20 19:26:42 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-05-20 18:40:02 -0400 |
commit | 96cb54981728f5f2af1706658ad44abfa9df24e7 (patch) | |
tree | 0f43218c507da0cadad01f4f250d38e00c9ba65d /hw | |
parent | 7dc7f12297bcee93e0b1974262d18c51cb386e8e (diff) | |
download | qemu-96cb54981728f5f2af1706658ad44abfa9df24e7.zip qemu-96cb54981728f5f2af1706658ad44abfa9df24e7.tar.gz qemu-96cb54981728f5f2af1706658ad44abfa9df24e7.tar.bz2 |
vhost-user-blk: Use started flag in vhost_user_blk_set_status()
Use started flag in vhost_user_blk_set_status() to decide if
starting vhost-user backend or not.
Signed-off-by: Xie Yongji <xieyongji@baidu.com>
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Message-Id: <20190320112646.3712-4-xieyongji@baidu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/vhost-user-blk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 28b8136..700c1dd 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -190,7 +190,7 @@ static void vhost_user_blk_stop(VirtIODevice *vdev) static void vhost_user_blk_set_status(VirtIODevice *vdev, uint8_t status) { VHostUserBlk *s = VHOST_USER_BLK(vdev); - bool should_start = status & VIRTIO_CONFIG_S_DRIVER_OK; + bool should_start = vdev->started; if (!vdev->vm_running) { should_start = false; @@ -350,7 +350,7 @@ static void vhost_user_blk_device_unrealize(DeviceState *dev, Error **errp) VHostUserBlk *s = VHOST_USER_BLK(dev); struct vhost_virtqueue *vqs = s->dev.vqs; - vhost_user_blk_set_status(vdev, 0); + virtio_set_status(vdev, 0); vhost_dev_cleanup(&s->dev); vhost_dev_free_inflight(s->inflight); g_free(vqs); |