qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v5 06/12] migration/dirtyrate: Record hash results for each s


From: David Edmondson
Subject: Re: [PATCH v5 06/12] migration/dirtyrate: Record hash results for each sampled page
Date: Thu, 27 Aug 2020 08:11:20 +0100

On Thursday, 2020-08-27 at 14:28:03 +08, Zheng Chuan wrote:

>>>> +static struct RamblockDirtyInfo *
>>>> +alloc_ramblock_dirty_info(int *block_index,
>>>> +                          struct RamblockDirtyInfo *block_dinfo)
>>>> +{
>>>> +    struct RamblockDirtyInfo *info = NULL;
>>>> +    int index = *block_index;
>>>> +
>>>> +    if (!block_dinfo) {
>>>> +        index = 0;
>>>> +        block_dinfo = g_try_new(struct RamblockDirtyInfo, 1);
>>>> +    } else {
>>>> +        index++;
>>>> +        block_dinfo = g_try_realloc(block_dinfo, (index + 1) *
>>>> +                                    sizeof(struct RamblockDirtyInfo));
>>>
>>> g_try_renew() instead of g_try_realloc()?
>>>
> Hi,
> I am not sure that because there only one place in qemu to use g_try_renew.
> Could you tell me why, because i think g_try_realloc will also return NULL 
> when error happen:)

Only suggested because it would make the two branches of the code more
similar.

dme.
-- 
And you can't hold me down, 'cause I belong to the hurricane.



reply via email to

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