Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-10-02 Thread Tomáš Golembiovský
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: > >> > >> > >> On 20/09/2016 11:41, Tomáš Golembiovský wrote: > >>> When image is part of the

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-09-20 Thread Richard W.M. Jones
On Tue, Sep 20, 2016 at 01:35:29PM +0200, Tomáš Golembiovský wrote: > The second patch tries to solve the situation when you have file: > > || some data ; image ; some more data || > > In this case there is no way to say where the image ends and client may > also access content in the "some

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-09-20 Thread Paolo Bonzini
On 20/09/2016 13:12, Daniel P. Berrange wrote: > On Tue, Sep 20, 2016 at 11:59:28AM +0200, Paolo Bonzini wrote: >> >> >> On 20/09/2016 11:41, Tomáš Golembiovský wrote: >>> 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

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-09-20 Thread Tomáš Golembiovský
On Tue, 20 Sep 2016 11:59:28 +0200 Paolo Bonzini wrote: > On 20/09/2016 11:41, Tomáš Golembiovský wrote: > > 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

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-09-20 Thread Daniel P. Berrange
On Tue, Sep 20, 2016 at 11:59:28AM +0200, Paolo Bonzini wrote: > > > On 20/09/2016 11:41, Tomáš Golembiovský wrote: > > 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

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-09-20 Thread Paolo Bonzini
On 20/09/2016 11:41, Tomáš Golembiovský wrote: > 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

[Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-09-20 Thread Tomáš Golembiovský
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