summaryrefslogtreecommitdiffstats
path: root/hw/virtio/vhost-user-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio/vhost-user-i2c.c')
-rw-r--r--hw/virtio/vhost-user-i2c.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/hw/virtio/vhost-user-i2c.c b/hw/virtio/vhost-user-i2c.c
index 6020eee093..b930cf6d5e 100644
--- a/hw/virtio/vhost-user-i2c.c
+++ b/hw/virtio/vhost-user-i2c.c
@@ -93,11 +93,7 @@ static void vu_i2c_stop(VirtIODevice *vdev)
static void vu_i2c_set_status(VirtIODevice *vdev, uint8_t status)
{
VHostUserI2C *i2c = VHOST_USER_I2C(vdev);
- bool should_start = status & VIRTIO_CONFIG_S_DRIVER_OK;
-
- if (!vdev->vm_running) {
- should_start = false;
- }
+ bool should_start = virtio_device_started(vdev, status);
if (i2c->vhost_dev.started == should_start) {
return;