From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38369 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ow9IX-0007wY-El for qemu-devel@nongnu.org; Thu, 16 Sep 2010 03:54:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ow9IW-0000I0-7T for qemu-devel@nongnu.org; Thu, 16 Sep 2010 03:54:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28688) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ow9IV-0000Hj-VL for qemu-devel@nongnu.org; Thu, 16 Sep 2010 03:54:24 -0400 Message-ID: <4C91CD42.8070403@redhat.com> Date: Thu, 16 Sep 2010 09:54:42 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1284213896-12705-1-git-send-email-aliguori@us.ibm.com> <1284213896-12705-2-git-send-email-aliguori@us.ibm.com> <4C8DDF18.5030703@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/3] block: allow migration to work with image files List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: Anthony Liguori , qemu-devel@nongnu.org, Stefan Hajnoczi Am 15.09.2010 18:03, schrieb Juan Quintela: > Kevin Wolf wrote: >> Am 11.09.2010 16:04, schrieb Anthony Liguori: > >> There is a simple generic implementation: >> >> drv = bs->drv; >> drv->close(bs); >> drv->open(bs, bs->open_flags); >> >> Note that this only reopens e.g. the qcow2 layer, but not the image >> file, which is bs->file. >> >> This works for all simple case, that is, one format on top of one or >> more protocols, where the protocols don't need invalidation. I think >> this includes everything that is possible today. With -blockdev we might >> need to revise this to include the lower layers, too. (But only >> sometimes, because we don't want to reopen the file) > > we require it for nfs consistency. We need to: > > source: fsync() > target: open() (after the fsync). > > About your 1st comment, I am doing: > > bdrv_close(bdrv); > bdrv_open(bdrv); > > Do you mean that this don't close and open again the file with qcow2? It does. bdrv_open/close take care of the whole stack. Kevin