block/vdi: Limit maximum size even futher
commitd20418ee514774626ac47a1ad0aa9149c7249cf0
authorMax Reitz <mreitz@redhat.com>
Tue, 28 Oct 2014 10:12:32 +0000 (28 11:12 +0100)
committerMax Reitz <mreitz@redhat.com>
Sun, 9 Nov 2014 22:39:50 +0000 (9 23:39 +0100)
tree3f2343113a49320ac9891a33b31e82f6c34091ce
parentd21de4d97faaad6ac21011d7bda924f9b2353b7b
block/vdi: Limit maximum size even futher

The block layer read and write functions do not like requests which are
bigger than INT_MAX bytes. Since the VDI bmap is read and written in a
single operation, its size is therefore limited accordingly. This
reduces the maximum VDI image size supported by QEMU to half of what it
currently is (down to approximately 512 TB).

The VDI test 084 has to be adapted accordingly. Actually, one could
clearly see that it was broken from the "Could not open
'TEST_DIR/t.IMGFMT': Invalid argument" line for an image which was
supposed to work just fine.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
block/vdi.c
tests/qemu-iotests/084
tests/qemu-iotests/084.out