From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W43gG-0001Y0-Ll for qemu-devel@nongnu.org; Fri, 17 Jan 2014 02:17:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W43g8-0002t4-8g for qemu-devel@nongnu.org; Fri, 17 Jan 2014 02:17:28 -0500 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:33609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W43g8-0002su-12 for qemu-devel@nongnu.org; Fri, 17 Jan 2014 02:17:20 -0500 Received: by mail-ea0-f174.google.com with SMTP id b10so1543271eae.33 for ; Thu, 16 Jan 2014 23:17:19 -0800 (PST) Date: Fri, 17 Jan 2014 15:17:10 +0800 From: Stefan Hajnoczi Message-ID: <20140117071710.GB19441@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Jeff Cody Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com 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? Thanks, Stefan