From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPxFf-000564-La for qemu-devel@nongnu.org; Mon, 14 Nov 2011 09:11:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPxFa-0004yg-Jg for qemu-devel@nongnu.org; Mon, 14 Nov 2011 09:11:11 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:40553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPxFa-0004yX-Eu for qemu-devel@nongnu.org; Mon, 14 Nov 2011 09:11:06 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 Nov 2011 09:11:04 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAEEAQ1X198622 for ; Mon, 14 Nov 2011 09:10:26 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAEEAMUd030405 for ; Mon, 14 Nov 2011 12:10:23 -0200 Message-ID: <4EC1214B.8050105@us.ibm.com> Date: Mon, 14 Nov 2011 08:10:19 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1321113420-3252-1-git-send-email-aliguori@us.ibm.com> <1321113420-3252-5-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/7] block: allow migration to work with image files (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com Cc: Kevin Wolf , Lucas Meneghel Rodrigues , Stefan Hajnoczi , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Avi Kivity On 11/14/2011 07:11 AM, Juan Quintela wrote: > >> diff --git a/cpus.c b/cpus.c >> index 82530c4..ae5ec99 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -398,6 +398,7 @@ static void do_vm_stop(RunState state) >> vm_state_notify(0, state); >> qemu_aio_flush(); >> bdrv_flush_all(); >> + bdrv_invalidate_cache_all(); >> monitor_protocol_event(QEVENT_STOP, NULL); >> } > > This is too much. Reopening all qcow2 images each time that we stop the > vm looks excesive, no? This general code came in via: http://mid.gmane.org/cover.1290613959.git.mst@redhat.com That series made migration stable after issuing a stop operation. I believe the justification was for debugging purposes or something like that. At any rate, invalidating the cache is part of what's required to make things stable. If you look at something like cache=unsafe, the only way the metadata will get flushed if via a bdrv_close since bdrv_flush is a nop. So this is needed as long as we care about supporting this use-case. Regards, Anthony Liguori > > Later, Juan. >