qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@parallels.com>, famz@redhat.com
Cc: Kevin Wolf <kwolf@redhat.com>, Benoit Canet <benoit@irqsave.net>,
	Vladimir Sementsov-Ogievskij <etendren@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Jd <jd_jedi@convirture.com>, Paolo Bonzini <pbonzini@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 02/10] qmp: Add block-dirty-bitmap-add and	block-dirty-bitmap-remove
Date: Wed, 19 Nov 2014 15:47:25 -0500	[thread overview]
Message-ID: <546D01DD.1040003@redhat.com> (raw)
In-Reply-To: <545CB9F6.5050906@parallels.com>



On 11/07/2014 07:24 AM, Vladimir Sementsov-Ogievskiy wrote:
>> +    if (!name || name[0] == '\0') {
> Isn't is better to move "name[0] == '\0'" check to
> bdrv_create_dirty_bitmap, near existed name checking?

Hm, OK, but then we still need to check for the presence of a name in 
these functions, so we're still going to be checking the validity of the 
name in both places regardless.

Probably not worth the effort. If somebody adds an empty string bitmap 
using bdrv_dirty_bitmap_create, it will at least be the only one named 
as such, and I don't think it will create any problems.

>> +        if (granularity < 512 || is_power_of_2(granularity)) {
>> +            error_setg(errp, "Granularity must be power of 2 "
>> +                             "and greater than 512");
>> +            return;
>> +        }
>> +    } else {
>> +        granularity = 65536;
>> +    }
> Why not using something like DEFAULT_CLUSTER_SIZE, as in block/qcow2.h ?
>

I don't want to tie this to explicitly qcow2, but on a suggestion from 
Fam, I think I will look at how block/mirror.c does this and tie it to 
the current cluster size -- which, if it's qcow2 -- will accomplish what 
you want, here.

-- 
—js

  reply	other threads:[~2014-11-19 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 12:24 [Qemu-devel] [PATCH v6 02/10] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove Vladimir Sementsov-Ogievskiy
2014-11-19 20:47 ` John Snow [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-30  3:22 [Qemu-devel] [PATCH v6 00/10] block: Incremental backup series Fam Zheng
2014-10-30  3:22 ` [Qemu-devel] [PATCH v6 02/10] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove Fam Zheng
2014-11-04  9:26   ` Max Reitz
2014-11-07 13:00   ` Eric Blake

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=546D01DD.1040003@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=etendren@gmail.com \
    --cc=famz@redhat.com \
    --cc=jd_jedi@convirture.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@parallels.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).