From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ig65G-0007Kw-OE for qemu-devel@nongnu.org; Thu, 11 Oct 2007 18:00:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ig65F-0007Ka-PL for qemu-devel@nongnu.org; Thu, 11 Oct 2007 18:00:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ig65F-0007KR-LV for qemu-devel@nongnu.org; Thu, 11 Oct 2007 18:00:45 -0400 Received: from sark4.cc.gatech.edu ([130.207.7.19]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ig65F-0004U4-0t for qemu-devel@nongnu.org; Thu, 11 Oct 2007 18:00:45 -0400 Received: from sark3.cc.gatech.edu (sark3.cc.gatech.edu [130.207.7.22]) by sark4.cc.gatech.edu (8.13.6/8.12.8) with ESMTP id l9BM0hRc026663 for ; Thu, 11 Oct 2007 18:00:43 -0400 (EDT) Received: from [192.168.0.143] (c-66-56-81-115.hsd1.ga.comcast.net [66.56.81.115]) (authenticated bits=0) by sark3.cc.gatech.edu (8.12.10/8.12.10) with ESMTP id l9BM0g9i026255 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Thu, 11 Oct 2007 18:00:43 -0400 (EDT) Message-ID: <470E9D0B.3090002@cc.gatech.edu> Date: Thu, 11 Oct 2007 18:00:43 -0400 From: Kaushik Bhandankar MIME-Version: 1.0 Subject: Re: [Qemu-devel] Pending Disk I/O requests during live VM migration References: <47050E64.5070901@cc.gatech.edu> <47051824.1080607@cc.gatech.edu> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org In ioemu/vl.c: do_savevm(), before saving the current VM state for live VM migration (qemu_savevm_state()), it calls qemu_aio_flush() in ioemu/block-raw.c. Now qemu_aio_flush() internally calls qemu_aio_poll() where we loop through the linked list of RawAIOCB structures and remove the request (qemu_aio_release()) only if the request is CANCELED or NOT IN PROGRESS. I am not really sure then why ioemu/hw/ide.c:pci_ide_save() has a comment saying "If a transfer is pending, we do not save it yet". Looking at qemu_aio_poll() doesn't seem to indicate so... Also, looking at /usr/include/aio.h sees to suggest that the pending requests get stored in the aio_buf of "struct aiocb" structure. Do the responses to these requests go in the same buffer (in which case the aio_buf and aio_nbytes would get overwritten by the response) ?? any help in this regard would be helful. -Kaushik Blue Swirl wrote: > On 10/4/07, Kaushik Bhandankar wrote: > >> 1) I guess the IDE disk code is in ioemu/hw/ide.c. But where is the IDE >> disk controller code located ?? >> > > Same file, see ide_ioport_write(). > > >> 2) I do not really understand BMDMA in ioemu/hw/ide.c. google doesnt >> seem to be helping much here. Any documentation about the QEMU IDE disks >> would be greatly appreciated. >> > > No idea. > > >> 3) vl.c:5522 seems to be not the correct code (I guess our vl.c codes >> are different).. Could you point me to the routine in vl.c where the >> pending disk IO requests are flushed before VM save (I guess the VM save >> happens in qemu_savevm_state() in vl.c wherein it invokes all the >> registered save handlers)? >> > > It's in: > void do_savevm(const char *name) > > >> 4) Somebody told me that the pending disk IO requests are stored >> somewhere in quemu's I/O disk model but I am not sure exactly >> where....Can somebody help me with this ? >> > > Qemu uses asynchronous IO, grepping aio or AIO should find something. > > > -- "question = ( to ) ? be : ! be;" -- Wm. Shakespeare