On Sat, Dec 6, 2014 at 12:33 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: > > > On 05/12/2014 17:15, Ming Lei wrote: >> From: Ming Lei <ming....@caonical.com> >> >> QEMU block should have supported to read/write at most >> 0x7fffff * 512 bytes, unfortunately INT_MAX is used to check >> bytes in both bdrv_co_do_writev() and bdrv_check_byte_request(), >> so cause write failure if nr_sectors is equal or more >> than 0x400000. >> >> There are still other INT_MAX usages in block.c, and they might >> need to change to UINT_MAX too in future, but at least >> this patch's change can make SCSI WRITE SAME 16 workable. >> >> Cc: qemu-sta...@nongnu.org >> Signed-off-by: Ming Lei <ming....@caonical.com> > > Alternatively, I'd accept a SCSI patch setting max_ws_blocks and friends > to 2GB - 1 block.
It should be better to not introduce the limit and split the writes into size of 2GB - 1 block since there is only the limit for write zero. Thanks,