qemu-devel
[Top][All Lists]
Advanced

[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: liu ping fan
Subject: Re: [Qemu-devel] about atexit() (was: [PATCH 5/5] hostmem: init/finalize hostmem listener)
Date: Thu, 13 Jun 2013 16:51:10 +0800

On Thu, Jun 13, 2013 at 12:38 PM, Amos Kong <address@hidden> wrote:
> 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?
>
SIG_KILL leaves no opportunity for us to do extra things, so I think
your suggestion is the only way out.
>
>>
>>      if (net_init_clients() < 0) {
>>          exit(1);
>> --
>
> --
>                         Amos.



reply via email to

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