From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqmWM-0003TX-FN for qemu-devel@nongnu.org; Sun, 02 Oct 2016 15:34:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqmWH-0001mL-CZ for qemu-devel@nongnu.org; Sun, 02 Oct 2016 15:33:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqmWH-0001mH-5o for qemu-devel@nongnu.org; Sun, 02 Oct 2016 15:33:53 -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 DA1CE19D245 for ; Sun, 2 Oct 2016 19:33:51 +0000 (UTC) Date: Sun, 2 Oct 2016 21:33:44 +0200 From: =?UTF-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Message-ID: <20161002213344.5963994a@fiorina> In-Reply-To: <7d43cbb2-6edf-78c0-89d0-09a58917ab56@redhat.com> References: <20160920114103.27aeea2a@fiorina> <30916fa0-a4b2-fa59-a594-38b172099fdb@redhat.com> <20160920111247.GE25490@redhat.com> <7d43cbb2-6edf-78c0-89d0-09a58917ab56@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: "Daniel P. Berrange" , qemu-devel@nongnu.org On Tue, 20 Sep 2016 13:45:08 +0200 Paolo Bonzini wrote: > On 20/09/2016 13:12, Daniel P. Berrange wrote: > > On Tue, Sep 20, 2016 at 11:59:28AM +0200, Paolo Bonzini wrote: =20 > >> > >> > >> On 20/09/2016 11:41, Tom=C3=A1=C5=A1 Golembiovsk=C3=BD wrote: =20 > >>> 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 the > >>> end of the file. This assumption may lead to reads/writes outside of = the > >>> image and thus lead to errors or data corruption. > >>> > >>> 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. = =20 > >=20 > > I don't think it makes sense as a special case in qemu-nbd. > >=20 > > 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. =20 >=20 > This makes sense too (and then --offset and partitions can be > implemented on top). OK. Let's drop this change then. I have sent an initial attempt to implement this in raw block driver here [1]. The change only covers files opened in read-only mode for the moment so it will take a little bit more effort before it can be used in qemu-nbd. That being said, I believe the first [2] part of the series still should be considered for merging. Unless there is something intrinsically wrong with the patch. Once the necessary stuff is in the raw driver we can change the related code in qemu-nbd. Regards, Tomas [1] https://lists.nongnu.org/archive/html/qemu-block/2016-10/msg00008.html [2] https://lists.nongnu.org/archive/html/qemu-devel/2016-09/msg04554.html --=20 Tom=C3=A1=C5=A1 Golembiovsk=C3=BD