浏览代码

virtio_balloon: enable VQs early on restore

virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after resume returns, virtio balloon
violated this rule by adding bufs, which causes the VQ to be used
directly within restore.

To fix, call virtio_device_ready before using VQ.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Michael S. Tsirkin 10 年之前
父节点
当前提交
486d2e632c
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/virtio/virtio_balloon.c

+ 2 - 0
drivers/virtio/virtio_balloon.c

@@ -538,6 +538,8 @@ static int virtballoon_restore(struct virtio_device *vdev)
 	if (ret)
 	if (ret)
 		return ret;
 		return ret;
 
 
+	virtio_device_ready(vdev);
+
 	fill_balloon(vb, towards_target(vb));
 	fill_balloon(vb, towards_target(vb));
 	update_balloon_size(vb);
 	update_balloon_size(vb);
 	return 0;
 	return 0;