qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [2.3 PATCH v7 05/10] block: Add bdrv_copy_dirty_bitmap


From: Markus Armbruster
Subject: Re: [Qemu-devel] [2.3 PATCH v7 05/10] block: Add bdrv_copy_dirty_bitmap and bdrv_reset_dirty_bitmap
Date: Thu, 27 Nov 2014 10:05:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 11/26/2014 05:43 AM, Max Reitz wrote:
>> On 2014-11-25 at 20:46, John Snow wrote:
>>> From: Fam Zheng <address@hidden>
>>>
>>> Signed-off-by: Fam Zheng <address@hidden>
>>> Signed-off-by: John Snow <address@hidden>
>>> ---
>>>   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()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]