From owner-freebsd-emulation@FreeBSD.ORG Mon Aug 24 06:58:33 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D926C106568C for ; Mon, 24 Aug 2009 06:58:33 +0000 (UTC) (envelope-from freebsd-emulation@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 6969D8FC12 for ; Mon, 24 Aug 2009 06:58:33 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MfTVZ-0001X7-J9 for freebsd-emulation@freebsd.org; Mon, 24 Aug 2009 08:58:25 +0200 Received: from 200.41.broadband11.iol.cz ([90.178.41.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Aug 2009 08:58:25 +0200 Received: from gamato by 200.41.broadband11.iol.cz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Aug 2009 08:58:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-emulation@freebsd.org From: martinko Date: Mon, 24 Aug 2009 08:58:02 +0200 Lines: 46 Message-ID: References: <200908232215.n7NMFqkK007704@triton8.kn-bremen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 200.41.broadband11.iol.cz User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.18) Gecko/20081125 SeaMonkey/1.1.13 In-Reply-To: <200908232215.n7NMFqkK007704@triton8.kn-bremen.de> Sender: news Subject: Re: Automagic bridged networking with QEMU (tap) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2009 06:58:33 -0000 Juergen Lock wrote: > > I like the idea, but found it needs a patch to qemu or otherwise a > KASSERT gets triggered in the tap driver (sys/net/if_tap.c:tap_destroy(), > causing a `tapX flags is out of sync' panic if the driver is built with > INVARIANTS) because the tap interface gets destroyed before its /dev/tap > fd is closed: > > Index: qemu/net.c > @@ -961,11 +961,12 @@ > { > TAPState *s = vc->opaque; > > - if (s->down_script[0]) > - launch_script(s->down_script, s->down_script_arg, s->fd); > - > qemu_set_fd_handler(s->fd, NULL, NULL, NULL); > close(s->fd); > + > + if (s->down_script[0]) > + launch_script(s->down_script, s->down_script_arg, -1); > + > qemu_free(s); > } > > I guess the driver could handle this condition more gracefully, but > until then... Oh and I also found the ifdown script doesn't get called > in all cases, like when you quit qemu via the monitor. > > Btw, can someone test this on 6.3? I'm wondering if we could ship > these ifup/down scripts in the qemu port(s) by default, maybe with an > rcvar added to enable them or something like that. (and the other > config instructions in the pkg-message file.) If you don't mind... :) Hallo Juergen, I certainly don't mind shipping those scripts of mine. Thank you for the patch, I wasn't aware of any panics, though I was thinking along the lines if it's ok to destroy a tap while Qemu apparently has got it open. I don't use Qemu monitor but I quess quitting from there should behave the same way and it's a Qemu bug if the scripts are not called, imho. Regards and thank you for all the work on Qemu port. Martin