All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: akong@redhat.com
Subject: Re: [Qemu-devel] [PATCH] tap: use an exit notifier to call down_script
Date: Wed, 13 Jul 2016 10:34:22 +0800	[thread overview]
Message-ID: <5785A8AE.9050207@redhat.com> (raw)
In-Reply-To: <71cb921e-afa5-6344-46b0-fdecfcc03a3d@redhat.com>



On 2016年07月12日 15:51, Paolo Bonzini wrote:
>
> On 12/07/2016 09:43, Jason Wang wrote:
>>
>> On 2016年07月11日 22:48, marcandre.lureau@redhat.com wrote:
>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>
>>> We would like to move back net_cleanup() at the end of main function,
>>> like it used to be until f30dbae63a46f23116715dff8d130c, but minimum
>>> tap cleanup is necessary regarless at exit() time. Use an exit notifier
>>> to call TAP down_script. If net_cleanup() is called first, then remove
>>> the exit notifier as it will become a dangling pointer otherwise.
>>>
>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>> This looks like a tap specific solution. But at least slirp wants to do
>> some cleanup too.
> Right, specifically slirp_smb_cleanup.
>
>> We need a generic solution. Does it work if we use
>> atexit(net_chr_cleanup) and first cleanup net and then chr at that
>> function?
> I think exit notifiers _are_ a generic solution.  Most pieces of QEMU
> don't care about cleanup at exit(), because the operating system takes
> care of it (freeing memory, closing file descriptors, etc.).
>
> Tap, slirp and chardev are exceptions, and they can use the exit
> notifiers.  I'll send a patch for slirp.
>
> Paolo
>

Ok.

Reviewed-by: Jason Wang <jasowang@redhat.com>

      reply	other threads:[~2016-07-13  2:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 14:48 [Qemu-devel] [PATCH] tap: use an exit notifier to call down_script marcandre.lureau
2016-07-12  7:43 ` Jason Wang
2016-07-12  7:51   ` Paolo Bonzini
2016-07-13  2:34     ` Jason Wang [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=5785A8AE.9050207@redhat.com \
    --to=jasowang@redhat.com \
    --cc=akong@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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.