From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brLor-0000yp-Tc for qemu-devel@nongnu.org; Tue, 04 Oct 2016 05:15:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brLop-00009b-Ib for qemu-devel@nongnu.org; Tue, 04 Oct 2016 05:15:24 -0400 Date: Tue, 4 Oct 2016 10:15:10 +0100 From: "Daniel P. Berrange" Message-ID: <20161004091510.GD5578@redhat.com> Reply-To: "Daniel P. Berrange" References: <598de7ff27e32fcb1b7f677f40fb8da4f0a1f512.1475434971.git.tgolembi@redhat.com> <20161003085213.GA13491@redhat.com> <20161003124557.76781119@fiorina> <20161003105259.GF13491@redhat.com> <20161003130707.6fcfd9dc@fiorina> <20161004085749.GA5316@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161004085749.GA5316@noname.str.redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org, Max Reitz On Tue, Oct 04, 2016 at 10:57:49AM +0200, Kevin Wolf wrote: > Am 03.10.2016 um 13:07 hat Tom=C3=A1=C5=A1 Golembiovsk=C3=BD geschriebe= n: > > > > > > + if (((bs->drv !=3D &bdrv_file) || !bs->read_only) && =20 > > > > >=20 > > > > > Why the check against bdrv_file ? =20 > > > >=20 > > > > To limit it only to files. Maybe there is better way to do that? = The > > > > devices have a nasty habit to change the size. Sure, this can hap= pen to > > > > file too, e.g. if somebody truncates the file outside QEMU. But t= hat's > > > > rather a bad behaviour. For devices changing the size may be perf= ectly > > > > valid operation, e.g. replacing CD in drive or card in a card rea= der. =20 > > >=20 > > > The raw driver is usable over any storage backend (file, rbd, iscsi= , > > > etc, etc) and it is valid to want to use a offset/size parameter in > > > combination with any of them. So we should not restrict it to just > > > files. >=20 > Just to clear up some confusion here: There are the file/host_device/..= . > protocol drivers, which only access local files. These are implemented > in raw-posix.c, i.e. the file that this patch is touching. raw-win32.c > implements the same kind of file access for Windows. This naming is constantly confusing - is there any appetite for renaming those to 'file-posix.c' and 'file-win32.c', and raw_bsd.c to raw.c ? Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr= / :|