Revert "blockmig: add option to skip zero blocks in bulk stage"

This reverts commit 1ed6cc4279d9dc978c54cee27885a603198df6a7.
iscsi: simplify freeing of tasks

Always free them in the iscsi_aio_*_acb functions and remove the
checks in their callers.  Remove ifs when the task struct was
previously dereferenced (spotted by Coverity).

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
iscsi: reorganize iscsi_readcapacity_sync

Avoid the goto, and use the same retry logic for the 10- and 16-
byte versions.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
iscsi: add bdrv_co_is_allocated

Signed-off-by: Peter Lieven <pl@kamp.de>
iscsi: add bdrv_co_write_zeroes

write zeroes is emulated by unmap if the
target supports unmapping an unmapped blocks
read as zero.

Signed-off-by: Peter Lieven <pl@kamp.de>
block: add bdrv_write_zeroes()

Signed-off-by: Peter Lieven <pl@kamp.de>
block/raw: add bdrv_co_write_zeroes

Signed-off-by: Peter Lieven <pl@kamp.de>
qemu-img: use bdrv_write_zeroes to write zeroes

Signed-off-by: Peter Lieven <pl@kamp.de>
iscsi: assert that sectors are aligned to LUN blocksize

if the blocksize of an iSCSI LUN is bigger than the BDRV_SECTOR_SIZE
it is possible that sector_num or nb_sectors are not correctly
alligned.

for now assert that there is no misalignment to avoid data
corruption.

Signed-off-by: Peter Lieven <pl@kamp.de>
block-migration: efficiently encode zero blocks

this patch adds a efficient encoding for zero blocks by
adding a new flag indiciating a block is completly zero.

additionally bdrv_write_zeros() is used at the destination
to efficiently write these zeroes. if the driver supports
it this avoids blindly allocating all sectors consumed by
zero blocks effectively re-thinning the device.

Signed-off-by: Peter Lieven <pl@kamp.de>
iscsi: add logical block provisioning information to iscsilun

Signed-off-by: Peter Lieven <pl@kamp.de>
Revert "migration: do not sent zero pages in bulk stage"

Not sending zero pages breaks migration if a page is zero
at the source but not at the destination. This can e.g. happen
if different BIOS versions are used at source and destination.
It has also been reported that migration on pseries is completely
broken with this patch.

This effectively reverts commit f1c72795af573b24a7da5eb52375c9aba8a37972.

Conflicts:

	arch_init.c

Signed-off-by: Peter Lieven <pl@kamp.de>
migration: do not overwrite zero pages

on incoming migration do not memset pages to zero if they already read as zero.
this will allocate a new zero page and consume memory unnecessarily. even
if we madvise a MADV_DONTNEED later this will only deallocate the memory
asynchronously.

Signed-off-by: Peter Lieven <pl@kamp.de>