@@ -1764,6 +1764,17 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
hdev->vdev = NULL;
}
+void vhost_dev_reset_all(void)
+{
+ struct vhost_dev *dev;
+
+ QLIST_FOREACH(dev, &vhost_devices, entry) {
+ if (dev->vhost_ops->vhost_reset_device(dev) < 0) {
+ VHOST_OPS_DEBUG("vhost_reset_device failed");
+ }
+ }
+}
+
int vhost_net_set_backend(struct vhost_dev *hdev,
struct vhost_vring_file *file)
{
@@ -105,6 +105,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
void vhost_dev_cleanup(struct vhost_dev *hdev);
int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev);
void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev);
+void vhost_dev_reset_all(void);
int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
@@ -135,6 +135,7 @@ void cprsave(const char *file, CprMode mode, Error **errp)
goto err;
}
walkenv(FD_PREFIX, preserve_fd, 0);
+ vhost_dev_reset_all();
setenv("QEMU_START_FREEZE", "", 1);
qemu_system_exec_request();
}