[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.
- Re: [PATCH v5 11/12] migration/dirtyrate: Implement qmp_cal_dirty_rate()/qmp_get_dirty_rate() function, (continued)
[PATCH v5 07/12] migration/dirtyrate: Compare page hash results for recorded sampled page, Chuan Zheng, 2020/08/24
[PATCH v5 09/12] migration/dirtyrate: Implement get_sample_page_period() and block_sample_page_period(), Chuan Zheng, 2020/08/24
[PATCH v5 12/12] migration/dirtyrate: Add trace_calls to make it easier to debug, Chuan Zheng, 2020/08/24
[PATCH v5 10/12] migration/dirtyrate: Implement calculate_dirtyrate() function, Chuan Zheng, 2020/08/24