block: avoid creating too large iovecs in multiwrite_merge
commite2a305fb13ff0f5cf6ff805555aaa90a5ed5954c
authorChristoph Hellwig <hch@lst.de>
Tue, 26 Jan 2010 13:49:08 +0000 (26 14:49 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 26 Jan 2010 23:08:03 +0000 (26 17:08 -0600)
treee31318d9be44e06a7ae9cda19369236fdbe2bcfc
parent6185c5783c50ab5bb4bcdc317772848278cb9bc1
block: avoid creating too large iovecs in multiwrite_merge

If we go over the maximum number of iovecs support by syscall we get
back EINVAL from the kernel which translate to I/O errors for the guest.

Add a MAX_IOV defintion for platforms that don't have it.  For now we use
the same 1024 define that's used on Linux and various other platforms,
but until the windows block backend implements some kind of vectored I/O
it doesn't matter.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block.c
qemu-common.h