Skip to contentSkip to conversation

AIO and savevm

Qemu-devel Blue Swirl 2 participants 2 messages Sep 3, 2006

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw
Quoted 4 lines

When savevm is issued, you need to halt the guest CPUs, and wait for all IO to complete. While doing this you need to allow device AIO completion routines to run, which may trigger additional IO. Once all IO has been completed you should then be able to safely save state.

How's this patch? Qemu_aio_poll waits for all AIOs and calls the device completion routines when each AIO finishes.

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.com/

Improve savevm consistency by flushing pending AIO before saving.

vl.c +3 -0
Index: qemu/vl.c
===================================================================
@@ -4551,6 +4551,9 @@
         return;
     }
 
+    /* Flush pending AIO before saving */
+    qemu_aio_poll();
+
     saved_vm_running = vm_running;
     vm_stop(0);
 
#1 lore raw
Quoted 8 lines · Blue Swirl
Quoted 5 lines

When savevm is issued, you need to halt the guest CPUs, and wait for all IO to
complete. While doing this you need to allow device AIO completion routines to run, which may trigger additional IO. Once all IO has been completed you should then be able to safely save state.

How's this patch? Qemu_aio_poll waits for all AIOs and calls the device completion routines when each AIO finishes.

qemu_aio_poll doesn't wait. It returns immediately if IO has not completed yet.

Paul