[PATCH kvmtool 9/9] virtio/blk: sync I/O on reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ensure that all requests are complete when resetting a virtqueue, by
draining the AIO queue after stopping the submission thread.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>
---
 virtio/blk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/virtio/blk.c b/virtio/blk.c
index 6e7a1ee36..50db6f5fc 100644
--- a/virtio/blk.c
+++ b/virtio/blk.c
@@ -248,6 +248,8 @@ static void exit_vq(struct kvm *kvm, void *dev, u32 vq)
 	close(bdev->io_efd);
 	pthread_cancel(bdev->io_thread);
 	pthread_join(bdev->io_thread, NULL);
+
+	disk_image__wait(bdev->disk);
 }
 
 static int notify_vq(struct kvm *kvm, void *dev, u32 vq)
-- 
2.20.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux