From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4C0C-0006x4-R4 for qemu-devel@nongnu.org; Fri, 17 Jan 2014 11:10:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4C06-0002SC-3v for qemu-devel@nongnu.org; Fri, 17 Jan 2014 11:10:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4C05-0002Qg-NV for qemu-devel@nongnu.org; Fri, 17 Jan 2014 11:10:29 -0500 Date: Fri, 17 Jan 2014 11:10:25 -0500 From: Jeff Cody Message-ID: <20140117161025.GB1485@localhost.localdomain> References: <20140117071710.GB19441@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140117071710.GB19441@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/2] block: commits of snapshots larger than backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Fri, Jan 17, 2014 at 03:17:10PM +0800, Stefan Hajnoczi wrote: > On Mon, Jan 13, 2014 at 03:18:44PM -0500, Jeff Cody wrote: > > If a snapshot is larger than a backing file, then the offline bdrv_commit and > > the live active layer commit will fail with an i/o error (usually). A live > > commit of a non-active layer will complete successfully, as it runs > > bdrv_truncate() on the backing image to resize it to the larger size. > > > > For both bdrv_commit() and commit_active_start(), this series will resize > > the underlying base image if needed. If the resize fails, an error will > > be returned. > > This got me thinking about the opposite case: when the snapshot is > smaller than the backing file. We leave the backing file with its > original size. In practice this is "safe" because the partition and > volume metadata should show the smaller size. If the user really wants > to shrink the device they can still truncate after completing the > "commit" operation. > > Can you update the QEMU documentation to explicitly cover both snapshot > > backing and snapshot < backing cases? > Yes, no problem.