[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] about atexit() (was: [PATCH 5/5] hostmem: init/finalize
From: |
Amos Kong |
Subject: |
Re: [Qemu-devel] about atexit() (was: [PATCH 5/5] hostmem: init/finalize hostmem listener) |
Date: |
Thu, 13 Jun 2013 12:38:29 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Apr 01, 2013 at 04:20:34PM +0800, Liu Ping Fan wrote:
> From: Liu Ping Fan <address@hidden>
>
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> vl.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 7643f16..46a25cf 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4157,6 +4157,7 @@ int main(int argc, char **argv, char **envp)
> }
>
> os_set_line_buffering();
> + hostmem_init();
>
> qemu_init_cpu_loop();
> qemu_mutex_lock_iothread();
> @@ -4174,6 +4175,7 @@ int main(int argc, char **argv, char **envp)
>
> /* clean up network at qemu process termination */
> atexit(&net_cleanup);
> + atexit(&hostmem_finalize);
The func registered by atexit() can only be called at normal termination.
If qemu process is abort() or killed by 'kill -9', the func won't be
called.
A known issue: at the abnormal termination, downscript could not be
executed to cleanup tap device. Can we suggest user to clean network
manually in this condition?
>
> if (net_init_clients() < 0) {
> exit(1);
> --
--
Amos.
- Re: [Qemu-devel] about atexit() (was: [PATCH 5/5] hostmem: init/finalize hostmem listener),
Amos Kong <=