When mirroring images, it makes sense for the destination to be sparse
even if it was not connected with "discard":"unmap"; the only time the
destination should be fully allocated is if the user pre-allocated it,
or if the source was not sparse.

Eric Blake (6):
  mirror: Skip pre-zeroing destination if it is already zero
  file-posix: Allow lseek at offset 0 when !want_zero
  mirror: Skip writing zeroes when target is already zero
  block: Expand block status mode from bool to enum
  file-posix: Recognize blockdev-create file as starting all zero
  tests: Add iotest mirror-sparse for recent patches

 block/coroutines.h                         |   4 +-
 include/block/block-common.h               |  26 ++++
 include/block/block_int-common.h           |  25 ++--
 include/block/block_int-io.h               |   4 +-
 block/io.c                                 |  51 +++----
 block/blkdebug.c                           |   6 +-
 block/copy-before-write.c                  |   4 +-
 block/file-posix.c                         |  94 +++++++++++--
 block/gluster.c                            |   4 +-
 block/iscsi.c                              |   6 +-
 block/mirror.c                             | 100 +++++++++++---
 block/nbd.c                                |   4 +-
 block/null.c                               |   6 +-
 block/parallels.c                          |   6 +-
 block/qcow.c                               |   2 +-
 block/qcow2.c                              |   6 +-
 block/qed.c                                |   6 +-
 block/quorum.c                             |   4 +-
 block/raw-format.c                         |   4 +-
 block/rbd.c                                |   6 +-
 block/snapshot-access.c                    |   4 +-
 block/vdi.c                                |   4 +-
 block/vmdk.c                               |   2 +-
 block/vpc.c                                |   2 +-
 block/vvfat.c                              |   6 +-
 tests/unit/test-block-iothread.c           |   2 +-
 tests/qemu-iotests/194                     |  15 +-
 tests/qemu-iotests/194.out                 |   4 +-
 tests/qemu-iotests/tests/mirror-sparse     | 100 ++++++++++++++
 tests/qemu-iotests/tests/mirror-sparse.out | 153 +++++++++++++++++++++
 30 files changed, 547 insertions(+), 113 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/mirror-sparse
 create mode 100644 tests/qemu-iotests/tests/mirror-sparse.out

-- 
2.49.0


Reply via email to