Received: from eggs.gnu.org ([2001:4830:134:3::10]:38523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzknG-0003T1-42 for qemu-devel@nongnu.org; Thu, 27 Oct 2016 09:32:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzknC-0007GQ-3L for qemu-devel@nongnu.org; Thu, 27 Oct 2016 09:32:30 -0400 Date: Thu, 27 Oct 2016 15:32:14 +0200 From: Kevin Wolf Message-ID: <20161027133214.GB4027@noname.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v7 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 27.10.2016 um 14:18 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 The changes that you made look correct to me, but I'm afraid they aren't complete: .bdrv_co_pwrite_zeroes() and .bdrv_co_pdiscard() don't consider the offset and size, so calling these when an offset is used will result in data corruption. It might also be necessary to return -ENOTSUP in .bdrv_probe_geometry() because we may return geometry for the real image file size rather than the part that is visible for the guest. I didn't see any other callbacks that involve offsets, but please double-check. Kevin