From f63c7a73555254562ce4e7352d710345e064ef99 Mon Sep 17 00:00:00 2001 From: Jian Jun Chen Date: Wed, 1 Aug 2018 15:40:45 +0800 Subject: [PATCH] dm: virtio: set VBS-K status to VIRTIO_DEV_INIT_SUCCESS after reset When reset VBS-K status should be set to VIRTIO_DEV_INIT_SUCCESS because at the time the char dev of VBS-K is still opened and when set_status callback is called later, it depends on VIRTIO_DEV_INIT_SUCCESS to resume. Signed-off-by: Jian Jun Chen Reviewed-by: Shuo Liu Acked-by: Yu Wang --- devicemodel/hw/pci/virtio/virtio_audio.c | 2 +- devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c | 2 +- devicemodel/hw/pci/virtio/virtio_rnd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devicemodel/hw/pci/virtio/virtio_audio.c b/devicemodel/hw/pci/virtio/virtio_audio.c index 0dbfdfc0a..42a8df134 100644 --- a/devicemodel/hw/pci/virtio/virtio_audio.c +++ b/devicemodel/hw/pci/virtio/virtio_audio.c @@ -195,7 +195,7 @@ virtio_audio_reset(void *base) DPRINTF(("virtio_audio: VBS-K reset requested!\n")); virtio_audio_kernel_stop(virt_audio); virtio_audio_kernel_reset(virt_audio); - virt_audio->vbs_k.kstatus = VIRTIO_DEV_INITIAL; + virt_audio->vbs_k.kstatus = VIRTIO_DEV_INIT_SUCCESS; } } diff --git a/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c b/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c index 1c854a114..12fabb3b9 100644 --- a/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c +++ b/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c @@ -186,7 +186,7 @@ virtio_hyper_dmabuf_reset(void *base) if (kstatus == VIRTIO_DEV_STARTED) { virtio_hyper_dmabuf_k_stop(); virtio_hyper_dmabuf_k_reset(); - kstatus = VIRTIO_DEV_INITIAL; + kstatus = VIRTIO_DEV_INIT_SUCCESS; } } diff --git a/devicemodel/hw/pci/virtio/virtio_rnd.c b/devicemodel/hw/pci/virtio/virtio_rnd.c index 0a9320418..cfddcd0c8 100644 --- a/devicemodel/hw/pci/virtio/virtio_rnd.c +++ b/devicemodel/hw/pci/virtio/virtio_rnd.c @@ -293,7 +293,7 @@ virtio_rnd_reset(void *base) DPRINTF(("virtio_rnd: VBS-K reset requested!\n")); virtio_rnd_kernel_stop(rnd); virtio_rnd_kernel_reset(rnd); - rnd->vbs_k.status = VIRTIO_DEV_INITIAL; + rnd->vbs_k.status = VIRTIO_DEV_INIT_SUCCESS; } }