mbox series

[RFC,v2,0/7] qemu-img convert with copy offloading

Message ID 20180418030424.28980-1-famz@redhat.com
Headers show
Series qemu-img convert with copy offloading | expand


Fam Zheng April 18, 2018, 3:04 a.m. UTC
v2: - Add iscsi EXTENDED COPY.
    - Design change: bdrv_co_copy_range_{from,to}. [Stefan]
    - Retry upon EINTR. [Stefan]
    - Drop the bounce buffer fallback. It is inefficient to attempt the
      offloaded copy over and over again if the error is returned from the host
      rather than checking our internal state. E.g.  trying copy_file_range
      between two filesystems results in EXDEV, in which case qemu-img.c should
      switch back to the copy path for the remaining sectors.

This series introduces block layer API for copy offloading and makes use of it
in qemu-img convert.

For now we implemented the operation in local file protocol with
copy_file_range(2).  Besides that it's possible to add similar to iscsi, nfs
and potentially more.

As far as its usage goes, in addition to qemu-img convert, we can emulate
offloading in scsi-disk (handle EXTENDED COPY command), and use the API in
block jobs too.

Fam Zheng (7):
  block: Introduce API for copy offloading
  raw: Implement copy offloading
  qcow2: Implement copy offloading
  file-posix: Implement bdrv_co_copy_range
  iscsi: Implement copy offloading
  block-backend: Add blk_co_copy_range
  qemu-img: Convert with copy offloading

 block/block-backend.c          |   9 ++
 block/file-posix.c             |  99 ++++++++++++++-
 block/io.c                     |  91 ++++++++++++++
 block/iscsi.c                  | 266 +++++++++++++++++++++++++++++++++++++++++
 block/qcow2.c                  | 224 +++++++++++++++++++++++++++++-----
 block/raw-format.c             |  20 ++++
 include/block/block.h          |   4 +
 include/block/block_int.h      |  30 +++++
 include/block/raw-aio.h        |  10 +-
 include/scsi/constants.h       |   3 +
 include/sysemu/block-backend.h |   4 +
 qemu-img.c                     |  50 +++++++-
 12 files changed, 773 insertions(+), 37 deletions(-)