qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: downscript not run when using quit in monitor


From: Jan Kiszka
Subject: [Qemu-devel] Re: downscript not run when using quit in monitor
Date: Tue, 24 Feb 2009 09:45:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Jędrzej Kalinowski wrote:
> On Thu, 19 Feb 2009 11:27:19 +0100, Jędrzej Kalinowski
> <address@hidden> wrote:
>> Hello,
>>
>> I'm using qemu to simulate various network booting scenarios w pxe/gPXE.
>> I use my ifup / ifdown script to set up / destroy tap devices form the
> qemu
>> instance. 
>>
>> However if I 'quit' qemu from the monitor - the downscript is not
> executed.
>> Is it by design or should it be classified as a bug? 
>> If it's fine - how can I close the machine properly (with downscript
>> execution) in -curses mode? It has no OS loaded - it didn't succeded to
>> boot from pxe..
>>
> 
> Following is a trivial patch I needed to apply to make downscripts
> execute...
> Maybe will save a few seconds to someone..
> 
> Cheers - Jędrzej
> 
> --- monitor.c.orig      2009-02-22 19:13:22.000000000 +0100
> +++ monitor.c   2009-02-22 18:53:17.000000000 +0100
> @@ -380,6 +380,7 @@
>  
>  static void do_quit(void)
>  {
> +    net_cleanup();
>      exit(0);
>  }
>  

Generally, this looks reasonable to me. But to catch also other exits,
you probably want to install an atexit handler. And please post your
patches with signed-off and an easily extractable commit comment.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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