qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong
Date: Tue, 21 Jan 2014 13:04:57 +0000

On 21 January 2014 12:24, Orit Wasserman <address@hidden> wrote:
> On 01/21/2014 02:11 PM, Gonglei (Arei) wrote:
>>
>> Hi,
>>
>> This is an update of my patch.
>> Modifications in v2:
>> * Removing excess check for g_free
>> * The structure of XBZRLE is divided into two halves.One is for
>> * src side, another is for dest side.
>>
>
> What is the benefit of splitting the structure?
> decode_buf is only allocated (and freed) in the destination any way.

It makes it clearer that it's not all valid and in
use. If you see a struct XBZRLE then the natural
assumption is that when you're done using it you
need to clean up every field in it, which is exactly
the bug that happened here and which this patch fixes.
If the "stuff used by sender" and "stuff used by
receiver" is split, then it's clear that in the sending
code path you need to set up and tear down exactly the
"sending stuff", and in the receiving code path only
the "receiving stuff".

thanks
-- PMM



reply via email to

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