From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0e1v-00086X-IB for qemu-devel@nongnu.org; Fri, 27 Jun 2014 17:50:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0e1m-0003R3-Gq for qemu-devel@nongnu.org; Fri, 27 Jun 2014 17:49:59 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:40853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0e1m-0003Qt-AO for qemu-devel@nongnu.org; Fri, 27 Jun 2014 17:49:50 -0400 Received: by mail-wi0-f182.google.com with SMTP id bs8so3417420wib.9 for ; Fri, 27 Jun 2014 14:49:48 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53ADE6F8.1070303@redhat.com> Date: Fri, 27 Jun 2014 23:49:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] The first function called after migration for a block device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiongzi Ge , qemu-devel@nongnu.org Il 27/06/2014 21:41, Xiongzi Ge ha scritto: > > When I studied the code, I found in migration.c, > bdrv_clear_incoming_migration_all(); > > the cache of the bdrv devices will be deleted. > > Is this the one for the functions to be called after migration? > > Does the bdrv device need to be reopen or load state in block.c? > > I would like to find this function to add my new code. This function is not going to do anything if your code is in "raw" format. In particular, it has *nothing* to do with the guest OS's cache. That cache is managed by the guest OS and, as I have already told you multiple times, there is *nothing* that QEMU can do about it. All you can do is use O_DIRECT in the guest. Paolo