diff mbox

vhost-user: Slave crashes as Master unmaps vrings during guest reboot

Message ID 1452889428-63039-2-git-send-email-shesha@cisco.com
State New
Headers show

Commit Message

Shesha Sreenivasamurthy Jan. 15, 2016, 8:23 p.m. UTC
Send VHOST_USER_RESET_OWNER when the device is stopped.

Signed-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>
---
 hw/virtio/vhost.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index de29968..808184f 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1256,6 +1256,11 @@  void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
                              hdev->vq_index + i);
     }
 
+    if (hdev->vhost_ops->vhost_reset_device(hdev) < 0) {
+        fprintf(stderr, "vhost reset device %s failed\n", vdev->name);
+        fflush(stderr);
+    }
+
     vhost_log_put(hdev, true);
     hdev->started = false;
     hdev->log = NULL;