[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] ram: Make RAMState dynamic
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] ram: Make RAMState dynamic |
Date: |
Tue, 06 Jun 2017 19:39:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Peter Xu <address@hidden> wrote:
> On Fri, Jun 02, 2017 at 12:08:13AM +0200, Juan Quintela wrote:
>> We create the variable while we are at migration and we remove it
>> after migration.
>>
>> Signed-off-by: Juan Quintela <address@hidden>
>> @@ -1818,6 +1825,8 @@ static int ram_state_init(RAMState *rs)
>> error_report("Error allocating current_buf");
>> g_free(XBZRLE.encoded_buf);
>> XBZRLE.encoded_buf = NULL;
>> + g_free(*rsp);
>> + *rsp = NULL;
>
> Though may not be directly related to this patch, but... do we need to
> destroy the two mutexes as well?
>
> (*rsp)->bitmap_mutex
> (*rsp)->src_page_req_mutex
>
I guess so. Will do on a next series.
> Also a nit: These several places I would slightly prefer a "goto
> xbzrle_fail", then:
>
> xbzrle_fail:
> if (XBZRLE.encoded_buf) {
> g_free(XBZRLE.encoded_buf);
> XBZRLE.encoded_buf = NULL;
> }
> qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
> qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
> g_free(*rsp);
> *rsp = NULL;
> return -1;
>
My idea is to split the XBZRLE bits from being all overal the code. But
that would be later O:-)
Later, Juan.
- Re: [Qemu-devel] [PATCH 3/5] migration: Print statistics about the number of remaining target pages, (continued)