From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lbsum-0007yf-63 for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:45:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lbsuk-0007xv-JW for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:45:19 -0500 Received: from [199.232.76.173] (port=43915 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lbsuk-0007xs-Eg for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:45:18 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:37238) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lbsuj-0000tr-Uj for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:45:18 -0500 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate01.web.de (Postfix) with ESMTP id D7962FDC58C8 for ; Tue, 24 Feb 2009 09:45:15 +0100 (CET) Received: from [88.65.41.114] (helo=[192.168.1.198]) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1Lbsuh-0000ao-00 for qemu-devel@nongnu.org; Tue, 24 Feb 2009 09:45:15 +0100 Message-ID: <49A3B39B.4030701@web.de> Date: Tue, 24 Feb 2009 09:45:15 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <01a73bd5af90e953f04f6ad80b151087@iem.pw.edu.pl> In-Reply-To: <01a73bd5af90e953f04f6ad80b151087@iem.pw.edu.pl> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig55FAF757857DBD235D4B62FE" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: downscript not run when using quit in monitor Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig55FAF757857DBD235D4B62FE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable J=C4=99drzej Kalinowski wrote: > On Thu, 19 Feb 2009 11:27:19 +0100, J=C4=99drzej Kalinowski > wrote: >> Hello, >> >> I'm using qemu to simulate various network booting scenarios w pxe/gPX= E. >> I use my ifup / ifdown script to set up / destroy tap devices form the= > qemu >> instance.=20 >> >> 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?=20 >> 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 t= o >> boot from pxe.. >> >=20 > Following is a trivial patch I needed to apply to make downscripts > execute... > Maybe will save a few seconds to someone.. >=20 > Cheers - J=C4=99drzej >=20 > --- 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 @@ > =20 > static void do_quit(void) > { > + net_cleanup(); > exit(0); > } > =20 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 --------------enig55FAF757857DBD235D4B62FE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkmjs5sACgkQniDOoMHTA+mWngCePWXIGQA/xbGAohTdPjl5gMCo 7KEAn229cV6JC3XarZZrS30TzMDRRdML =x4oP -----END PGP SIGNATURE----- --------------enig55FAF757857DBD235D4B62FE--