From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60833 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBPVf-0005QA-5p for qemu-devel@nongnu.org; Thu, 28 Oct 2010 06:15:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBPVe-0005Ca-5T for qemu-devel@nongnu.org; Thu, 28 Oct 2010 06:15:03 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:37404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBPVe-0005CM-23 for qemu-devel@nongnu.org; Thu, 28 Oct 2010 06:15:02 -0400 Received: by yxd5 with SMTP id 5so1175581yxd.4 for ; Thu, 28 Oct 2010 03:15:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4CC84AA4.2030701@redhat.com> References: <1287759383-14114-1-git-send-email-stefanha@linux.vnet.ibm.com> <1287759383-14114-6-git-send-email-stefanha@linux.vnet.ibm.com> <4CC84AA4.2030701@redhat.com> Date: Thu, 28 Oct 2010 11:15:01 +0100 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH v3 5/5] qed: Consistency check support From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Anthony Liguori , Christoph Hellwig , Stefan Hajnoczi , Avi Kivity On Wed, Oct 27, 2010 at 4:52 PM, Kevin Wolf wrote: > Am 22.10.2010 16:56, schrieb Stefan Hajnoczi: >> This patch adds support for the qemu-img check command. =A0It also >> introduces a dirty bit in the qed header to mark modified images as >> needing a check. =A0This bit is cleared when the image file is closed >> cleanly. >> >> If an image file is opened and it has the dirty bit set, a consistency >> check will run and try to fix corrupted table offsets. =A0These >> corruptions may occur if there is power loss while an allocating write >> is performed. =A0Once the image is fixed it opens as normal again. >> >> Signed-off-by: Stefan Hajnoczi > > Hm, do I understand right that you fix the image and reset the dirty > flag in the header during bdrv_open? So how does this work with > migration, when the destination host opens the QED file before the > source closes it? Doesn't the destination destroy the image by "fixing" i= t? > > And even if that wasn't the case, clearing the flag means that the > source might do new writes and thinks that the flag is still set. If the > source crashes now, we may need a consistency check, but the dirty flag > isn't set any more. > > Am I missing some detail? You're right, migration is not supported. This is also true for the other image formats which cache metadata in memory though. I am actually looking into migration next together with Adam Litke who has already started. We'll have to defer accessing the file until the source has flushed/closed it. Stefan