From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
agraf@suse.de, qemu-devel@nongnu.org, qiaonuohan@cn.fujitsu.com,
pbonzini@redhat.com, lersek@redhat.com
Subject: Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()
Date: Fri, 15 Aug 2014 06:03:16 +0800 [thread overview]
Message-ID: <53ED3224.70801@gmail.com> (raw)
In-Reply-To: <20140814164945.2a0290fb@redhat.com>
On 08/15/2014 04:49 AM, Luiz Capitulino wrote:
> On Sun, 03 Aug 2014 23:28:56 +0800
> Chen Gang <gang.chen.5i5j@gmail.com> wrote:
>
>> > In dump_init(), when failure occurs, need notice about 'fd' and memory
>> > mapping. So call dump_cleanup() for it (need let all initializations at
>> > front).
>> >
>> > Also simplify dump_cleanup(): remove redundant 'ret' and redundant 'fd'
>> > checking.
>> >
>> > Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> Applied to the qmp branch, thanks.
>
Thanks.
> PS: I still find it hard to track the file-descriptor's life time. IMO,
> the best would be to always release it where it's allocated which is
> qmp_dump_guest_memory().
>
If it is really hard to track, for me, I prefer to let dump_cleanup()
common enough, so can simplify every members thinking.
When use genric *_cleanup(), it means the resource manage management is
a little complex, need use a generic cleanup function for it to be sure
that every thing is not missed, and always save enough.
Thanks.
--
Chen Gang
Open share and attitude like air water and life which God blessed
prev parent reply other threads:[~2014-08-14 22:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-03 15:28 [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init() Chen Gang
2014-08-03 15:56 ` Laszlo Ersek
2014-08-04 13:51 ` Chen Gang
2014-08-11 19:47 ` Chen Gang
2014-08-04 7:59 ` [Qemu-devel] Cc'ing emails [was: [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()] Michael Tokarev
2014-08-04 14:13 ` Chen Gang
2014-08-04 15:43 ` [Qemu-devel] Cc'ing emails [ Markus Armbruster
2014-08-05 4:41 ` Chen Gang
2014-08-05 7:08 ` Michael Tokarev
2014-08-05 8:07 ` Peter Maydell
2014-08-05 12:20 ` Chen Gang
2014-08-05 9:41 ` Markus Armbruster
2014-08-05 13:25 ` Anthony Liguori
2014-08-12 15:43 ` [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init() Laszlo Ersek
2014-08-12 22:19 ` Chen Gang
2014-08-14 20:49 ` Luiz Capitulino
2014-08-14 22:03 ` Chen Gang [this message]
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=53ED3224.70801@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=agraf@suse.de \
--cc=lcapitulino@redhat.com \
--cc=lersek@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=qiaonuohan@cn.fujitsu.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).