qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org
Cc: kwolf@redhat.com, den@openvz.org, mreitz@redhat.com,
	qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v12 1/2] block/backup: fix max_transfer handling for copy_range
Date: Wed, 18 Sep 2019 15:57:33 -0400	[thread overview]
Message-ID: <4122264a-f7db-8b76-6930-87e2287c49b8@redhat.com> (raw)
In-Reply-To: <20190917160731.10895-2-vsementsov@virtuozzo.com>



On 9/17/19 12:07 PM, Vladimir Sementsov-Ogievskiy wrote:
> Of course, QEMU_ALIGN_UP is a typo, it should be QEMU_ALIGN_DOWN, as we
> are trying to find aligned size which satisfy both source and target.
> Also, don't ignore too small max_transfer. In this case seems safer to
> disable copy_range.
> 
> Fixes: 9ded4a0114968e
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   block/backup.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/block/backup.c b/block/backup.c
> index 763f0d7ff6..d8fdbfadfe 100644
> --- a/block/backup.c
> +++ b/block/backup.c
> @@ -741,12 +741,16 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
>       job->cluster_size = cluster_size;
>       job->copy_bitmap = copy_bitmap;
>       copy_bitmap = NULL;
> -    job->use_copy_range = !compress; /* compression isn't supported for it */
>       job->copy_range_size = MIN_NON_ZERO(blk_get_max_transfer(job->common.blk),
>                                           blk_get_max_transfer(job->target));
> -    job->copy_range_size = MAX(job->cluster_size,
> -                               QEMU_ALIGN_UP(job->copy_range_size,
> -                                             job->cluster_size));
> +    job->copy_range_size = QEMU_ALIGN_DOWN(job->copy_range_size,
> +                                           job->cluster_size);
> +    /*
> +     * Compression is not supported for copy_range. Also, we don't want to
> +     * handle small max_transfer for copy_range (which currently don't
> +     * handle max_transfer at all).
> +     */
> +    job->use_copy_range = !compress && job->copy_range_size > 0;
>   
>       /* Required permissions are already taken with target's blk_new() */
>       block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL,
> 

I'm clear on the alignment fix, I'm not clear on the comment about 
max_transfer and how it relates to copy_range_size being non-zero.

"small max transfer" -- what happens when it's zero? we're apparently OK 
with a single cluster, but when it's zero, what happens?


  reply	other threads:[~2019-09-18 19:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 16:07 [Qemu-devel] [PATCH v12 0/2] backup: copy_range fixes Vladimir Sementsov-Ogievskiy
2019-09-17 16:07 ` [Qemu-devel] [PATCH v12 1/2] block/backup: fix max_transfer handling for copy_range Vladimir Sementsov-Ogievskiy
2019-09-18 19:57   ` John Snow [this message]
2019-09-19  6:50     ` Vladimir Sementsov-Ogievskiy
2019-09-20  1:13       ` John Snow
2019-09-20  7:52         ` Vladimir Sementsov-Ogievskiy
2019-09-17 16:07 ` [Qemu-devel] [PATCH v12 2/2] block/backup: fix backup_cow_with_offload for last cluster Vladimir Sementsov-Ogievskiy
2019-09-18 20:14   ` John Snow
2019-09-19  7:02     ` Vladimir Sementsov-Ogievskiy
2019-09-20  0:55       ` John Snow

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=4122264a-f7db-8b76-6930-87e2287c49b8@redhat.com \
    --to=jsnow@redhat.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=vsementsov@virtuozzo.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).