On Tue, 4 Jun 2019 15:34:56 +0800 elohi...@gmail.com wrote: > From: Xie Yongji <xieyon...@baidu.com> > > Besides virtio 1.0 transitional devices, we should also > set "start_on_kick" flag for legacy devices (virtio 0.9). > > Signed-off-by: Xie Yongji <xieyon...@baidu.com> > ---
Patch looks good but it would be even better if applied earlier so that it doesn't revert lines added by the previous patch... > hw/virtio/virtio.c | 2 -- > include/hw/virtio/virtio.h | 2 +- > 2 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 6508b2faad..6ec45d8f0a 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -2080,7 +2080,6 @@ int virtio_set_features(VirtIODevice *vdev, uint64_t > val) > } > > if (!vdev->started && > - virtio_host_has_feature(vdev, VIRTIO_F_VERSION_1) && ... here and... > !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { > vdev->start_on_kick = true; > } > @@ -2236,7 +2235,6 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int > version_id) > } > > if (!vdev->started && > - virtio_host_has_feature(vdev, VIRTIO_F_VERSION_1) && ... here. > !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { > vdev->start_on_kick = true; > } > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index 27c0efc3d0..303242b3c2 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -106,7 +106,7 @@ struct VirtIODevice > bool vm_running; > bool broken; /* device in invalid state, needs reset */ > bool started; > - bool start_on_kick; /* virtio 1.0 transitional devices support that */ > + bool start_on_kick; /* when virtio 1.0 feature has not been negotiated */ > VMChangeStateEntry *vmstate; > char *bus_name; > uint8_t device_endian;