qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Peter Lieven <pl@kamp.de>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/9] block: Introduce API for copy offloading
Date: Thu, 10 May 2018 09:44:01 +0100	[thread overview]
Message-ID: <20180510084401.GE1296@stefanha-x1.localdomain> (raw)
In-Reply-To: <20180509145815.3330-2-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]

On Wed, May 09, 2018 at 10:58:07PM +0800, Fam Zheng wrote:

Please include a commit description:

  Introduce the bdrv_co_copy_range() API for copy offloading.  Block
  drivers implementing this API support efficient copy operations that
  avoid reading each block from the source device and writing it to the
  destination devices.  Examples of copy offload primitives are SCSI
  EXTENDED COPY and Linux copy_file_range(2).

This explains the purpose of the new API.

> +/* Copy range from @bs to @dst. */

There is no @bs argument, I guess it should be @src.

What about the return value?

What about the flags?

You don't need to duplicate this information, just reference
BlockDriver.bdrv_co_copy_range_from() if you want.

> +int bdrv_co_copy_range_from(BdrvChild *src, uint64_t src_offset,
> +                            BdrvChild *dst, uint64_t dst_offset,
> +                            uint64_t bytes, BdrvRequestFlags flags)
> +{
> +    return bdrv_co_copy_range_internal(src, src_offset, dst, dst_offset,
> +                                       bytes, flags, true);
> +}
> +
> +/* Copy range from @src to @bs. Should only be called by block drivers when @bs
> + * is the leaf. */

Same here.

> diff --git a/include/block/block.h b/include/block/block.h
> index cdec3639a3..72ac011b2b 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -604,4 +604,8 @@ bool bdrv_can_store_new_dirty_bitmap(BlockDriverState *bs, const char *name,
>   */
>  void bdrv_register_buf(BlockDriverState *bs, void *host, size_t size);
>  void bdrv_unregister_buf(BlockDriverState *bs, void *host);
> +
> +int bdrv_co_copy_range(BdrvChild *bs, uint64_t offset,
> +                       BdrvChild *src, uint64_t src_offset,
> +                       uint64_t bytes, BdrvRequestFlags flags);

This is the public API.  It's missing a doc comment.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2018-05-10  8:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 14:58 [Qemu-devel] [PATCH v3 0/9] qemu-img convert with copy offloading Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 1/9] block: Introduce API for " Fam Zheng
2018-05-10  8:44   ` Stefan Hajnoczi [this message]
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 2/9] raw: Implement " Fam Zheng
2018-05-09 15:17   ` Eric Blake
2018-05-11  6:19     ` Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 3/9] qcow2: " Fam Zheng
2018-05-10  9:25   ` Stefan Hajnoczi
2018-05-10 14:51     ` Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 4/9] file-posix: Implement bdrv_co_copy_range Fam Zheng
2018-05-10  8:50   ` Stefan Hajnoczi
2018-05-11  7:20     ` Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 5/9] iscsi: Query and save device designator when opening Fam Zheng
2018-05-10  8:54   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 6/9] iscsi: Create and use iscsi_co_wait_for_task Fam Zheng
2018-05-09 15:19   ` Eric Blake
2018-05-10  8:58   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 7/9] iscsi: Implement copy offloading Fam Zheng
2018-05-10  9:04   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 8/9] block-backend: Add blk_co_copy_range Fam Zheng
2018-05-10  9:05   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 9/9] qemu-img: Convert with copy offloading Fam Zheng
2018-05-10  9:08   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180510084401.GE1296@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).