Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GJpRE-0001nH-Hz for qemu-devel@nongnu.org; Sun, 03 Sep 2006 06:42:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GJpRC-0001mO-8u for qemu-devel@nongnu.org; Sun, 03 Sep 2006 06:42:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GJpRC-0001mK-4N for qemu-devel@nongnu.org; Sun, 03 Sep 2006 06:42:50 -0400 Received: from [65.54.246.110] (helo=bay0-omc1-s38.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GJpbT-0005BK-6U for qemu-devel@nongnu.org; Sun, 03 Sep 2006 06:53:27 -0400 Message-ID: From: "Blue Swirl" Subject: Re: [Qemu-devel] AIO and savevm Date: Sun, 03 Sep 2006 12:42:43 +0200 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_5a96_5d4e_5e8d" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: paul@codesourcery.com Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_5a96_5d4e_5e8d Content-Type: text/plain; format=flowed >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/ ------=_NextPart_000_5a96_5d4e_5e8d Content-Type: text/plain; name="aio_flush.diff"; format=flowed Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="aio_flush.diff" Improve savevm consistency by flushing pending AIO before saving. Index: qemu/vl.c =================================================================== --- qemu.orig/vl.c 2006-09-03 10:31:48.000000000 +0000 +++ qemu/vl.c 2006-09-03 10:33:51.000000000 +0000 @@ -4551,6 +4551,9 @@ return; } + /* Flush pending AIO before saving */ + qemu_aio_poll(); + saved_vm_running = vm_running; vm_stop(0); ------=_NextPart_000_5a96_5d4e_5e8d--