vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macro

Macro could be used to migrate a dynamically allocated buffer of known size.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1362923278-4080-2-git-send-email-i.mitsyanko@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 8070568b9aa8d93b3729ab7e9ca0ef8a6351d2bd)
vmstate: Add support for two dimensional arrays

Add support for migrating two dimensional arrays, by defining
a set of new macros VMSTATE_*_2DARRAY paralleling the existing
VMSTATE_*_ARRAY macros. 2D arrays are handled the same for actual
state serialization; the only difference is that the type check
has to change for a 2D array.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Message-id: 1363975375-3166-2-git-send-email-peter.maydell@linaro.org
(cherry picked from commit bd7f92e59e7f40ddaeda40e55f7818c8121ecf1a)
block: Introduce bdrv_writev_vmstate
savevm: Implement block_writev_buffer()

Instead of breaking up RAM state into many small chunks, pass the iovec
to the block layer for better performance.
block: Introduce bdrv_pwritev() for qcow2_save_vmstate

Directly pass the QEMUIOVector on instead of linearising it.
qemu-iotests: A few more bdrv_pread/pwrite test
Merge branch 'qemu.dev.staging.1' of https://github.com/luohao-brian/qemu-kvm into qemu.dev.staging.1