qemu-stable
[Top][All Lists]
Advanced

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

Re: [Qemu-stable] [Qemu-devel] [PATCH v2] migration:fix free XBZRLE deco


From: Gonglei (Arei)
Subject: Re: [Qemu-stable] [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong
Date: Tue, 21 Jan 2014 12:58:45 +0000

> -----Original Message-----
> From: Orit Wasserman [mailto:address@hidden
> Sent: Tuesday, January 21, 2014 8:24 PM
> To: Gonglei (Arei); address@hidden; address@hidden; Peter
> Maydell; address@hidden; address@hidden
> Cc: chenliang (T); Luonengjun; Huangweidong (Hardware)
> Subject: Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf
> wrong
> 
> 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.

Yeah, you are right. Splitting the structure is not necessary. 
The key to do that is just for clear logic. As Peter said: 
the current arrangement looks extremely prone to bugs like 
this one where somebody forgets that some of the fields are 
not relevant to whichever of src/dst the code path they're 
writing is used on.

Best regards,
-Gonglei


reply via email to

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