From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmIyt-0003qk-Dh for qemu-devel@nongnu.org; Tue, 20 Sep 2016 07:12:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmIyp-00048E-AW for qemu-devel@nongnu.org; Tue, 20 Sep 2016 07:12:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmIyp-00047V-4C for qemu-devel@nongnu.org; Tue, 20 Sep 2016 07:12:51 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 96C33C054906 for ; Tue, 20 Sep 2016 11:12:50 +0000 (UTC) Date: Tue, 20 Sep 2016 12:12:47 +0100 From: "Daniel P. Berrange" Message-ID: <20160920111247.GE25490@redhat.com> Reply-To: "Daniel P. Berrange" References: <20160920114103.27aeea2a@fiorina> <30916fa0-a4b2-fa59-a594-38b172099fdb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <30916fa0-a4b2-fa59-a594-38b172099fdb@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= , qemu-devel@nongnu.org On Tue, Sep 20, 2016 at 11:59:28AM +0200, Paolo Bonzini wrote: >=20 >=20 > On 20/09/2016 11:41, Tom=C3=A1=C5=A1 Golembiovsk=C3=BD wrote: > > When image is part of the file it makes sense to limit the length of = the > > image in the file. Otherwise it is assumed that the image spans to th= e > > end of the file. This assumption may lead to reads/writes outside of = the > > image and thus lead to errors or data corruption. > >=20 > > To limit the assumed image size new option is introduced. >=20 > The patch makes sense, but I think the commit message is incorrect > because this bug is already fixed by patch 1. Also, the option in the > help is --device-size, not --image-size; I would just call it --size. I don't think it makes sense as a special case in qemu-nbd. It feels like this is better done by extending the 'raw' block driver with 'offset' and 'length' parameters. You can then layer the 'raw' block driver over any existing QEMU blocker driver, anywhere in QEMU / tools that accept a block device description. No need to add extra parameters to any of the programs. Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://autobuild.org -o- http://search.cpan.org/~danberr= / :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vn= c :|