Re: [Qemu-devel] [PATCH 2/2] block/vdi: Do not use bdrv_pwrite_sync() for bmap

2014-10-21 Thread Eric Blake
On 10/21/2014 02:51 AM, Max Reitz wrote: > The bmap can be rather large (maximum blocks per image count: > 0x3fff; the bmap has a size of block_count * sizeof(uint32_t) bytes, > which makes 0xfffc bytes) and exceed INT_MAX. Using block layer > functions which take a byte count as an int is

[Qemu-devel] [PATCH 2/2] block/vdi: Do not use bdrv_pwrite_sync() for bmap

2014-10-21 Thread Max Reitz
The bmap can be rather large (maximum blocks per image count: 0x3fff; the bmap has a size of block_count * sizeof(uint32_t) bytes, which makes 0xfffc bytes) and exceed INT_MAX. Using block layer functions which take a byte count as an int is therefore not a good idea. Use bdrv_write()+bdrv_