qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] tap: use an exit notifier to call down_script


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH] tap: use an exit notifier to call down_script
Date: Wed, 13 Jul 2016 10:34:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0



On 2016年07月12日 15:51, Paolo Bonzini wrote:

On 12/07/2016 09:43, Jason Wang wrote:

On 2016年07月11日 22:48, address@hidden wrote:
From: Marc-André Lureau <address@hidden>

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 <address@hidden>
Suggested-by: Paolo Bonzini <address@hidden>
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 <address@hidden>



reply via email to

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