From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrCAG-0007nC-AB for qemu-devel@nongnu.org; Wed, 19 Nov 2014 15:47:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrCA8-0005dj-6H for qemu-devel@nongnu.org; Wed, 19 Nov 2014 15:47:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrCA7-0005db-UO for qemu-devel@nongnu.org; Wed, 19 Nov 2014 15:47:40 -0500 Message-ID: <546D01DD.1040003@redhat.com> Date: Wed, 19 Nov 2014 15:47:25 -0500 From: John Snow MIME-Version: 1.0 References: 1414639364-4499-3-git-send-email-famz@redhat.com <545CB9F6.5050906@parallels.com> In-Reply-To: <545CB9F6.5050906@parallels.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 02/10] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , famz@redhat.com Cc: Kevin Wolf , Benoit Canet , Vladimir Sementsov-Ogievskij , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Jd , Paolo Bonzini , Luiz Capitulino On 11/07/2014 07:24 AM, Vladimir Sementsov-Ogievskiy wrote: >> + if (!name || name[0] =3D=3D '\0') { > Isn't is better to move "name[0] =3D=3D '\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=20 these functions, so we're still going to be checking the validity of the=20 name in both places regardless. Probably not worth the effort. If somebody adds an empty string bitmap=20 using bdrv_dirty_bitmap_create, it will at least be the only one named=20 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 =3D 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=20 Fam, I think I will look at how block/mirror.c does this and tie it to=20 the current cluster size -- which, if it's qcow2 -- will accomplish what=20 you want, here. --=20 =E2=80=94js