From: Orit Wasserman <owasserm@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"qemu-stable@nongnu.org" <qemu-stable@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>,
"anthony@codemonkey.ws" <anthony@codemonkey.ws>,
"pbonzini@redhat.com" <pbonzini@redhat.com>
Cc: "chenliang (T)" <chenliang88@huawei.com>,
Luonengjun <luonengjun@huawei.com>,
"Huangweidong (Hardware)" <huangweidong@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong
Date: Wed, 22 Jan 2014 07:51:49 +0200 [thread overview]
Message-ID: <52DF5C75.80505@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020815BBA0C@SZXEMA503-MBS.china.huawei.com>
On 01/21/2014 02:58 PM, Gonglei (Arei) wrote:
>
>> -----Original Message-----
>> From: Orit Wasserman [mailto:owasserm@redhat.com]
>> Sent: Tuesday, January 21, 2014 8:24 PM
>> To: Gonglei (Arei); qemu-devel@nongnu.org; qemu-stable@nongnu.org; Peter
>> Maydell; anthony@codemonkey.ws; pbonzini@redhat.com
>> 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
>
Sounds reasonable.
Thanks for finding the leak and fixing it.
Orit
Orit
next prev parent reply other threads:[~2014-01-22 5:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 12:11 [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong Gonglei (Arei)
2014-01-21 12:24 ` Orit Wasserman
2014-01-21 12:58 ` Gonglei (Arei)
2014-01-22 5:51 ` Orit Wasserman [this message]
2014-01-21 13:04 ` Peter Maydell
2014-01-21 13:46 ` Eric Blake
2014-01-23 2:51 ` Gonglei (Arei)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52DF5C75.80505@redhat.com \
--to=owasserm@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=arei.gonglei@huawei.com \
--cc=chenliang88@huawei.com \
--cc=huangweidong@huawei.com \
--cc=luonengjun@huawei.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.