Changes since v1 [1]: * Added review tags * Fixed lkvm-static build, using $(OBJS_STATOPT/DYNOPT) in the makefile rather than $(OBJS). Patches 1-7 fix a few issues found while testing disk backends, and patches 8-9 implement reset for the AIO backend. By draining the AIO queue on reset, we avoid writing I/O completions to the used ring after the guest reclaimed the ring's pages. [1] https://www.spinics.net/lists/kvm/msg182324.html Jean-Philippe Brucker (9): qcow: Fix qcow1 exit fault virtio/blk: Set VIRTIO_BLK_F_RO when the disk is read-only guest: sync disk before shutting down disk/aio: Refactor AIO code disk/aio: Fix use of disk->async disk/aio: Fix AIO thread disk/aio: Cancel AIO thread on cleanup disk/aio: Add wait() disk operation virtio/blk: sync I/O on reset Makefile | 2 + disk/aio.c | 150 +++++++++++++++++++++++++++++++++++++++ disk/blk.c | 10 +-- disk/core.c | 69 ++++++++---------- disk/qcow.c | 3 +- disk/raw.c | 56 +++------------ guest/init.c | 1 + include/kvm/disk-image.h | 53 ++++++++++++-- include/kvm/read-write.h | 11 --- util/read-write.c | 36 ---------- virtio/blk.c | 7 +- 11 files changed, 249 insertions(+), 149 deletions(-) create mode 100644 disk/aio.c -- 2.21.0