Received: from eggs.gnu.org ([2001:4830:134:3::10]:55599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDrmG-0005w0-Uk for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:04:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDrm8-0006f3-1R for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:03:56 -0400 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:55228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDrm7-0006em-Ro for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:03:47 -0400 Received: by mail-ea0-f174.google.com with SMTP id z15so1422912ead.19 for ; Mon, 26 Aug 2013 01:03:47 -0700 (PDT) Date: Mon, 26 Aug 2013 10:03:44 +0200 From: Stefan Hajnoczi Message-ID: <20130826080344.GA28949@stefanha-thinkpad.redhat.com> References: <1376307710-15641-1-git-send-email-alex@alex.org.uk> <20130822114513.GC27613@stefanha-thinkpad.redhat.com> <260EC92C-EBBE-4744-99CC-8836E5CE1390@alex.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <260EC92C-EBBE-4744-99CC-8836E5CE1390@alex.org.uk> Subject: Re: [Qemu-devel] [PATCHv4] add qemu-img convert -C option (skip target volume creation) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, Alexandre Derumier On Thu, Aug 22, 2013 at 08:27:12PM +0100, Alex Bligh wrote: > > On 22 Aug 2013, at 12:45, Stefan Hajnoczi wrote: > The behaviour of the current code appears to be as follows > (Alexandre's code not mine): > > a) if the target volume size > the converted volume size, convert > leaving the remaining data on the target volume as is. This > is I believe useful, as on (e.g.) rbd, the target volume size > may be larger than required due to rounding requirements. Seems ok. > b) if the target volume size < the converted volume size, convert > truncates it but does not error. I'm torn between whether this > continue to do exactly as it asked, attempt to expand the > volume, or error. These all seem reasonably easy (the expand > option presumably being a call to bdrv_truncate). Silently truncating can be a problem, e.g. the user deletes the original file after conversion completes and later discovers not all data was copied. I think we should fail here. Stefan