qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] downscript not run when using quit in monitor
@ 2009-02-19 10:27 Jędrzej Kalinowski
  2009-02-24  0:41 ` Jędrzej Kalinowski
  0 siblings, 1 reply; 3+ messages in thread
From: Jędrzej Kalinowski @ 2009-02-19 10:27 UTC (permalink / raw)
  To: qemu-devel


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..

Thanks,
Jedrzej Kalinowski
-- 
JK

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] downscript not run when using quit in monitor
  2009-02-19 10:27 [Qemu-devel] downscript not run when using quit in monitor Jędrzej Kalinowski
@ 2009-02-24  0:41 ` Jędrzej Kalinowski
  2009-02-24  8:45   ` [Qemu-devel] " Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Jędrzej Kalinowski @ 2009-02-24  0:41 UTC (permalink / raw)
  To: qemu-devel


On Thu, 19 Feb 2009 11:27:19 +0100, Jędrzej Kalinowski
<kalinoj1@iem.pw.edu.pl> 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);
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: downscript not run when using quit in monitor
  2009-02-24  0:41 ` Jędrzej Kalinowski
@ 2009-02-24  8:45   ` Jan Kiszka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2009-02-24  8:45 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

Jędrzej Kalinowski wrote:
> On Thu, 19 Feb 2009 11:27:19 +0100, Jędrzej Kalinowski
> <kalinoj1@iem.pw.edu.pl> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-24  8:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 10:27 [Qemu-devel] downscript not run when using quit in monitor Jędrzej Kalinowski
2009-02-24  0:41 ` Jędrzej Kalinowski
2009-02-24  8:45   ` [Qemu-devel] " Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).