Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Eric Blake
On 10/04/2016 04:15 AM, Daniel P. Berrange wrote: > On Tue, Oct 04, 2016 at 10:57:49AM +0200, Kevin Wolf wrote: >> Am 03.10.2016 um 13:07 hat Tomáš Golembiovský geschrieben: >>> +if (((bs->drv != &bdrv_file) || !bs->read_only) && >> >> Why the check against bdrv_file ? > >

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Kevin Wolf
Am 04.10.2016 um 12:12 hat Paolo Bonzini geschrieben: > > > On 04/10/2016 11:24, Kevin Wolf wrote: > > You also need to update the options for the blockdev-add QMP command in > > qapi/block-core.json. The relevant type is BlockdevOptionsFile. > > Is it? Or should he define a new BlockdevOptionsR

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Tomáš Golembiovský
On Tue, 4 Oct 2016 10:57:49 +0200 Kevin Wolf wrote: > Am 03.10.2016 um 13:07 hat Tomáš Golembiovský geschrieben: > > > > > > +if (((bs->drv != &bdrv_file) || !bs->read_only) && > > > > > > > > > > Why the check against bdrv_file ? > > > > > > > > To limit it only to files. Maybe t

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Paolo Bonzini
On 04/10/2016 11:24, Kevin Wolf wrote: > You also need to update the options for the blockdev-add QMP command in > qapi/block-core.json. The relevant type is BlockdevOptionsFile. Is it? Or should he define a new BlockdevOptionsRaw, and point to it in the BlockdevOptions union instead of "'raw':

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Kevin Wolf
Am 02.10.2016 um 21:13 hat Tomáš Golembiovský geschrieben: > Added two new options 'offset' and 'size'. This makes it possible to use > 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

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Daniel P. Berrange
On Tue, Oct 04, 2016 at 10:57:49AM +0200, Kevin Wolf wrote: > Am 03.10.2016 um 13:07 hat Tomáš Golembiovský geschrieben: > > > > > > +if (((bs->drv != &bdrv_file) || !bs->read_only) && > > > > > > > > > > Why the check against bdrv_file ? > > > > > > > > To limit it only to files. Maybe

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-04 Thread Kevin Wolf
Am 03.10.2016 um 13:07 hat Tomáš Golembiovský geschrieben: > > > > > +if (((bs->drv != &bdrv_file) || !bs->read_only) && > > > > > > > > Why the check against bdrv_file ? > > > > > > To limit it only to files. Maybe there is better way to do that? The > > > devices have a nasty habit to

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Eric Blake
On 10/02/2016 02:13 PM, Tomáš Golembiovský wrote: > Added two new options 'offset' and 'size'. This makes it possible to use > 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). >

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Paolo Bonzini
On 03/10/2016 12:47, Tomáš Golembiovský wrote: > On Mon, 3 Oct 2016 11:20:44 +0200 > Paolo Bonzini wrote: > >> On 03/10/2016 10:52, Daniel P. Berrange wrote: >>> On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: Added two new options 'offset' and 'size'. This makes it p

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Daniel P. Berrange
On Mon, Oct 03, 2016 at 01:07:07PM +0200, Tomáš Golembiovský wrote: > On Mon, 3 Oct 2016 11:52:59 +0100 > > > > > > > + > > > > > +if (((bs->drv != &bdrv_file) || !bs->read_only) && > > > > > > > > Why the check against bdrv_file ? > > > > > > To limit it only to files. Maybe there is

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Tomáš Golembiovský
On Mon, 3 Oct 2016 11:52:59 +0100 "Daniel P. Berrange" wrote: > On Mon, Oct 03, 2016 at 12:45:57PM +0200, Tomáš Golembiovský wrote: > > On Mon, 3 Oct 2016 09:52:13 +0100 > > "Daniel P. Berrange" wrote: > > > > > On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: > > > > Add

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Daniel P. Berrange
On Mon, Oct 03, 2016 at 12:45:57PM +0200, Tomáš Golembiovský wrote: > On Mon, 3 Oct 2016 09:52:13 +0100 > "Daniel P. Berrange" wrote: > > > On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: > > > Added two new options 'offset' and 'size'. This makes it possible to use > > > only

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Tomáš Golembiovský
On Mon, 3 Oct 2016 11:20:44 +0200 Paolo Bonzini wrote: > On 03/10/2016 10:52, Daniel P. Berrange wrote: > > On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: > >> Added two new options 'offset' and 'size'. This makes it possible to use > >> only part of the file as a device. T

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Tomáš Golembiovský
On Mon, 3 Oct 2016 09:52:13 +0100 "Daniel P. Berrange" wrote: > On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: > > Added two new options 'offset' and 'size'. This makes it possible to use > > only part of the file as a device. This can be used e.g. to limit the > > access onl

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Paolo Bonzini
On 03/10/2016 10:52, Daniel P. Berrange wrote: > On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: >> Added two new options 'offset' and 'size'. This makes it possible to use >> only part of the file as a device. This can be used e.g. to limit the >> access only to single partit

Re: [Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-03 Thread Daniel P. Berrange
On Sun, Oct 02, 2016 at 09:13:29PM +0200, Tomáš Golembiovský wrote: > Added two new options 'offset' and 'size'. This makes it possible to use > 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 archi

[Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-02 Thread Tomáš Golembiovský
Added two new options 'offset' and 'size'. This makes it possible to use 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). For now this is only possible for files in read-only mode. I