Re: [Qemu-devel] [PATCH 1/2] qemu-nbd: Shrink image size by specified offset

2016-10-03 Thread Eric Blake
On 10/03/2016 08:50 AM, Tomáš Golembiovský wrote: >> Additional context: >> >> off_t dev_offset = 0; >> >> off_t fd_size; >> >>> >>> +if (dev_offset >= fd_size) { >>> +error_report("Offset (%lu) has to be smaller than the image size >>> (%lu)", >>> + dev_o

Re: [Qemu-devel] [PATCH 1/2] qemu-nbd: Shrink image size by specified offset

2016-10-03 Thread Tomáš Golembiovský
Whops, somehow I completely forgot about this. On Tue, 20 Sep 2016 09:09:59 -0500 Eric Blake wrote: > On 09/20/2016 04:37 AM, Tomáš Golembiovský wrote: > > [meta-comment]: Your series came through without any threading (you sent > three threads, instead of patch 1 and 2 being marked In-Reply-To

Re: [Qemu-devel] [PATCH 1/2] qemu-nbd: Shrink image size by specified offset

2016-09-20 Thread Eric Blake
On 09/20/2016 04:37 AM, Tomáš Golembiovský wrote: [meta-comment]: Your series came through without any threading (you sent three threads, instead of patch 1 and 2 being marked In-Reply-To the 0/2 cover letter). > When --offset is set the apparent device size has to be adjusted > accordingly. Othe

Re: [Qemu-devel] [PATCH 1/2] qemu-nbd: Shrink image size by specified offset

2016-09-20 Thread Paolo Bonzini
On 20/09/2016 11:37, Tomáš Golembiovský wrote: > When --offset is set the apparent device size has to be adjusted > accordingly. Otherwise client may request read/write beyond the file end > which would fail. > > Signed-off-by: Tomáš Golembiovský > --- > qemu-nbd.c | 7 +++ > 1 file change

[Qemu-devel] [PATCH 1/2] qemu-nbd: Shrink image size by specified offset

2016-09-20 Thread Tomáš Golembiovský
When --offset is set the apparent device size has to be adjusted accordingly. Otherwise client may request read/write beyond the file end which would fail. Signed-off-by: Tomáš Golembiovský --- qemu-nbd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/qemu-nbd.c b/qemu-nbd.c index 99