From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1AVI-0001Pf-Le for qemu-devel@nongnu.org; Mon, 31 Oct 2016 07:11:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1AVH-0002Wj-Tn for qemu-devel@nongnu.org; Mon, 31 Oct 2016 07:11:48 -0400 Date: Mon, 31 Oct 2016 12:11:37 +0100 From: Kevin Wolf Message-ID: <20161031111137.GA5522@noname.redhat.com> References: <99db1b09f35af003a9f624d30a39fc6befc2fe54.1477909279.git.tgolembi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <99db1b09f35af003a9f624d30a39fc6befc2fe54.1477909279.git.tgolembi@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v8 1/2] raw_bsd: add offset and size options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Cc: qemu-devel@nongnu.org, Max Reitz , Markus Armbruster , Eric Blake , "Daniel P . Berrange" , qemu-block@nongnu.org Am 31.10.2016 um 11:27 hat Tom=C3=A1=C5=A1 Golembiovsk=C3=BD geschrieben: > Added two new options 'offset' and 'size'. This makes it possible to us= e > only part of the file as a device. This can be used e.g. to limit the > access only to single partition in a disk image or use a disk inside a > tar archive (like OVA). >=20 > When 'size' is specified we do our best to honour it. >=20 > Signed-off-by: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD > @@ -181,6 +356,10 @@ static BlockAIOCB *raw_aio_ioctl(BlockDriverState = *bs, > BlockCompletionFunc *cb, > void *opaque) > { > + BDRVRawState *s =3D bs->opaque; > + if (s->offset || s->has_size) { > + return NULL; > + } > return bdrv_aio_ioctl(bs->file->bs, req, buf, cb, opaque); > } > =20 This hunk had a real merge conflict (aio -> co), so I'm posting my conflict resolution below. Kevin @@ -178,6 +353,10 @@ static void raw_lock_medium(BlockDriverState *bs, bo= ol locked) =20 static int raw_co_ioctl(BlockDriverState *bs, unsigned long int req, voi= d *buf) { + BDRVRawState *s =3D bs->opaque; + if (s->offset || s->has_size) { + return -ENOTSUP; + } return bdrv_co_ioctl(bs->file->bs, req, buf); }