Received: from eggs.gnu.org ([2001:4830:134:3::10]:54269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtv1G-00071l-4S for qemu-devel@nongnu.org; Thu, 27 Nov 2014 04:05:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtv19-0002yY-Qv for qemu-devel@nongnu.org; Thu, 27 Nov 2014 04:05:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtv19-0002wK-Bi for qemu-devel@nongnu.org; Thu, 27 Nov 2014 04:05:39 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAR95cmM012826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 27 Nov 2014 04:05:38 -0500 From: Markus Armbruster References: <1416944800-17919-1-git-send-email-jsnow@redhat.com> <1416944800-17919-6-git-send-email-jsnow@redhat.com> <5475CAF1.9070603@redhat.com> <5475F93F.8050704@redhat.com> Date: Thu, 27 Nov 2014 10:05:36 +0100 In-Reply-To: <5475F93F.8050704@redhat.com> (Eric Blake's message of "Wed, 26 Nov 2014 09:01:03 -0700") Message-ID: <87d289ko7z.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [2.3 PATCH v7 05/10] block: Add bdrv_copy_dirty_bitmap and bdrv_reset_dirty_bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Fam Zheng , John Snow , qemu-devel@nongnu.org, Max Reitz Eric Blake writes: > On 11/26/2014 05:43 AM, Max Reitz wrote: >> On 2014-11-25 at 20:46, John Snow wrote: >>> From: Fam Zheng >>> >>> Signed-off-by: Fam Zheng >>> Signed-off-by: John Snow >>> --- >>> block.c | 35 +++++++++++++++++++++++++++++++---- >>> include/block/block.h | 4 ++++ >>> 2 files changed, 35 insertions(+), 4 deletions(-) >>> > >>> @@ -5406,7 +5431,9 @@ int64_t >>> bdrv_dbm_calc_def_granularity(BlockDriverState *bs) >>> int64_t bdrv_dirty_bitmap_granularity(BlockDriverState *bs, >>> BdrvDirtyBitmap *bitmap) >>> { >>> - return BDRV_SECTOR_SIZE << hbitmap_granularity(bitmap->bitmap); >>> + g_assert(BDRV_SECTOR_SIZE << hbitmap_granularity(bitmap->bitmap) >>> == \ >>> + bitmap->granularity); >> >> Do you really need that backslash? >> >> If you don't and remove it, or if you do and keep it, and with either >> "name ? g_strdup(name) : NULL" left as-is or replace by "g_strdup(name)": >> > > g_strdup(NULL) is safe, so 'name ? g_strdup(name) : NULL' is pointless > and can be written as 'g_strdup(name)' with no change in functionality. Yes, please. See also: 80e0090 virtio: Drop superfluous conditionals around g_strdup() c14e984 vnc: Drop superfluous conditionals around g_strdup()