From owner-freebsd-virtualization@FreeBSD.ORG Sun Jan 23 14:33:13 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABCF91065746 for ; Sun, 23 Jan 2011 14:33:13 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5228FC32 for ; Sun, 23 Jan 2011 14:33:12 +0000 (UTC) Received: by fxm16 with SMTP id 16so3478657fxm.13 for ; Sun, 23 Jan 2011 06:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=nn/vtFP6yKz4TPT9uENg9bV2rfBnrtXCLOTlXQqpz+w=; b=LJ6720EwKNU5kYpEnHPBl7yyv+LVZ9TO5CXk5EFgcVYf2eME+IVncFbrW04OyPYlIo PhIF22uqA23sd9fFC4Bkg2+KFIzBOJ5Wm4sED5fdLmgGvwAsF44zkn59i6zmqXLrYmt4 ZdSNqcsLhM7ww5mzFOSboaAyepAnSiHwfE7vQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=rm+PHWzv10SRk2KZCEZlLa7keJw2IZoV43NjdSvkgw+YiPs6gCsa5zgzgmW23N9wog YU5UrYYN9jlStPeuiC2o48LShVl6DTUgCOm/h5gKG3/aLaRWtBSovg8K4ZQH8TzZnzpS ugSk+tl10msNgfQF13TazwFOuQQPXiyDQc5nY= Received: by 10.223.86.196 with SMTP id t4mr3049464fal.34.1295793191579; Sun, 23 Jan 2011 06:33:11 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id r24sm4223665fax.27.2011.01.23.06.33.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 23 Jan 2011 06:33:10 -0800 (PST) From: Mikolaj Golub To: freebsd-virtualization@FreeBSD.org, freebsd-emulation@freebsd.org Date: Sun, 23 Jan 2011 16:33:07 +0200 Message-ID: <86oc77heqk.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Subject: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 14:33:13 -0000 --=-=-= Hi, Sorry for cross posting, but this question concerns both VirtualBox and VIMAGE :-). I would like to be able to run VirtualBox on my desktop, with kernel compilled with VIMAGE, so I would use light vnet jails for FreeBSD VMs and VirtualBox for other OSes. Currently the system will crash if you try to use VirtualBox bridged networking under VIMAGE kernel. The crash may look like below: db> bt Tracing pid 2349 tid 100239 td 0xc984b2d0 ifunit(c7e3b9ac,6f,c129e970,f8089984,c08d6dc0,...) at ifunit+0x33 vboxNetFltOsInitInstance(c7e3b810,0,8,7,c9aa6ae0,...) at vboxNetFltOsInitInstance+0x31 vboxNetFltFactoryCreateAndConnect(c9aa8cc8,c96636d4,c9664010,0,c966403c,...) at vboxNetFltFactory CreateAndConnect+0x1f7 _end(c7b11810,c962c238,3,c962c2b8,0,...) at 0xc9c0114f _end(c7b11810,c962c22c,f20,c0d31268,f8089a90,...) at 0xc9c01265 _end(c962c22c,0,0,c7b11810,c0cfe2fe,...) at 0xc9bbc775 _end(f808a000,fffffffd,28,c962c22c,0,...) at 0xc9bbd086 supdrvIOCtl(c10c5607,c12a0a40,c7b11810,c962c200,c0e81df8,...) at supdrvIOCtl+0x1af1 VBoxDrvFreeBSDIOCtl(c94efb00,c10c5607,c962c200,3,c984b2d0,...) at VBoxDrvFreeBSDIOCtl+0x1ea devfs_ioctl_f(c8e70118,c10c5607,c962c200,c9a82900,c984b2d0,...) at devfs_ioctl_f+0x10b kern_ioctl(c984b2d0,e,c10c5607,c962c200,1089cec,...) at kern_ioctl+0x1fd ioctl(c984b2d0,f8089cec,2b077000,1,c94ed2a8,...) at ioctl+0x134 syscallenter(c984b2d0,f8089ce4,c0c20e2d,c0e83290,0,...) at syscallenter+0x2a6 syscall(f8089d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x282ae093, esp = 0xbf8b980c, ebp = 0xbf8b9828 --- So it crashes when a function (ifunit in this case) tries to access virtualized variable (V_ifnet in this case). The macro uses td->td_vnet for this, which should be set to current vnet, but for VBox driver threads it is NULL. As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the attached patch). This has fixed the issue for me and now I am happily running both VNET jails and VirtualBox machines on my desktop. But the way I fixed the issue looks hackish for me. Could someone suggest a better solution? In case someone is interested in trying this patch, below are the instructions how to build "VIMAGE safe" vbox driver from ports: cd /usr/ports/emulators/virtualbox-ose-kmod make patch cd work patch -p0 < /path/to/VirtualBox-3.2.12.VIMAGE.patch cd .. VIMAGE=1 make -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=VirtualBox-3.2.12.VIMAGE.patch diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2011-01-23 12:44:24.000000000 +0200 @@ -26,6 +26,10 @@ CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DI CFLAGS += -DRT_ARCH_AMD64 .endif +.if defined(VIMAGE) + CFLAGS += -DVIMAGE +.endif + SRCS = \ VBoxNetFlt-freebsd.c \ VBoxNetFlt.c \ diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2011-01-23 12:14:19.000000000 +0200 @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -322,6 +323,7 @@ static int ng_vboxnetflt_rcvdata(hook_p struct m_tag *mtag; bool fActive; + CURVNET_SET_QUIET(vnet0); fActive = vboxNetFltTryRetainBusyActive(pThis); NGI_GET_M(item, m); @@ -346,6 +348,7 @@ static int ng_vboxnetflt_rcvdata(hook_p ether_demux(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); @@ -363,6 +366,7 @@ static int ng_vboxnetflt_rcvdata(hook_p int rc = ether_output_frame(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return rc; } mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); @@ -377,6 +381,7 @@ static int ng_vboxnetflt_rcvdata(hook_p if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } @@ -409,6 +414,7 @@ static void vboxNetFltFreeBSDinput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(vnet0); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -438,6 +444,7 @@ static void vboxNetFltFreeBSDinput(void ether_demux(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -452,6 +459,7 @@ static void vboxNetFltFreeBSDoutput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(vnet0); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -481,6 +489,7 @@ static void vboxNetFltFreeBSDoutput(void ether_output_frame(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -497,6 +506,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS bool fActive; int error; + CURVNET_SET_QUIET(vnet0); ifp = (void *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); if (fDst & INTNETTRUNKDIR_WIRE) @@ -539,6 +549,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS m->m_pkthdr.rcvif = ifp; ifp->if_input(ifp, m); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -556,6 +567,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT node_p node; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; + CURVNET_SET_QUIET(vnet0); NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -602,6 +614,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); vboxNetFltRelease(pThis, true /*fBusy*/); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -610,6 +623,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX { struct ifnet *ifp, *ifp0; + CURVNET_SET_QUIET(vnet0); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); /* * Attempt to check if the interface is still there and re-initialize if @@ -628,6 +642,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX vboxNetFltOsDeleteInstance(pThis); vboxNetFltOsInitInstance(pThis, NULL); } + CURVNET_RESTORE() return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); } @@ -667,6 +682,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF char path[NG_PATHSIZ]; Log(("%s: fActive:%d\n", __func__, fActive)); + CURVNET_SET_QUIET(vnet0); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); node = (node_p)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.node); @@ -742,6 +758,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF strlcpy(rm->ourhook, "output", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); } + CURVNET_RESTORE(); } int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) --=-=-=-- From owner-freebsd-virtualization@FreeBSD.ORG Mon Jan 24 08:12:01 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A344106564A; Mon, 24 Jan 2011 08:12:01 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id BA6768FC27; Mon, 24 Jan 2011 08:12:00 +0000 (UTC) Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p0O7a9hm059479 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 24 Jan 2011 07:36:22 GMT (envelope-from julian@freebsd.org) Message-ID: <4D3D2DE9.2060004@freebsd.org> Date: Sun, 23 Jan 2011 23:44:41 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mikolaj Golub References: <86oc77heqk.fsf@kopusha.home.net> In-Reply-To: <86oc77heqk.fsf@kopusha.home.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 08:12:01 -0000 On 1/23/11 6:33 AM, Mikolaj Golub wrote: > Hi, > > Sorry for cross posting, but this question concerns both VirtualBox and VIMAGE :-). > > I would like to be able to run VirtualBox on my desktop, with kernel compilled > with VIMAGE, so I would use light vnet jails for FreeBSD VMs and VirtualBox > for other OSes. > > Currently the system will crash if you try to use VirtualBox bridged > networking under VIMAGE kernel. > > The crash may look like below: > > db> bt > > Tracing pid 2349 tid 100239 td 0xc984b2d0 > ifunit(c7e3b9ac,6f,c129e970,f8089984,c08d6dc0,...) at ifunit+0x33 > vboxNetFltOsInitInstance(c7e3b810,0,8,7,c9aa6ae0,...) at vboxNetFltOsInitInstance+0x31 > vboxNetFltFactoryCreateAndConnect(c9aa8cc8,c96636d4,c9664010,0,c966403c,...) at vboxNetFltFactory > CreateAndConnect+0x1f7 > _end(c7b11810,c962c238,3,c962c2b8,0,...) at 0xc9c0114f > _end(c7b11810,c962c22c,f20,c0d31268,f8089a90,...) at 0xc9c01265 > _end(c962c22c,0,0,c7b11810,c0cfe2fe,...) at 0xc9bbc775 > _end(f808a000,fffffffd,28,c962c22c,0,...) at 0xc9bbd086 > supdrvIOCtl(c10c5607,c12a0a40,c7b11810,c962c200,c0e81df8,...) at supdrvIOCtl+0x1af1 > VBoxDrvFreeBSDIOCtl(c94efb00,c10c5607,c962c200,3,c984b2d0,...) at VBoxDrvFreeBSDIOCtl+0x1ea > devfs_ioctl_f(c8e70118,c10c5607,c962c200,c9a82900,c984b2d0,...) at devfs_ioctl_f+0x10b > kern_ioctl(c984b2d0,e,c10c5607,c962c200,1089cec,...) at kern_ioctl+0x1fd > ioctl(c984b2d0,f8089cec,2b077000,1,c94ed2a8,...) at ioctl+0x134 > syscallenter(c984b2d0,f8089ce4,c0c20e2d,c0e83290,0,...) at syscallenter+0x2a6 > syscall(f8089d28) at syscall+0x4f > Xint0x80_syscall() at Xint0x80_syscall+0x21 > --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x282ae093, esp = 0xbf8b980c, ebp = 0xbf8b9828 --- > > So it crashes when a function (ifunit in this case) tries to access > virtualized variable (V_ifnet in this case). The macro uses td->td_vnet for > this, which should be set to current vnet, but for VBox driver threads it is > NULL. > > As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions > CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the > attached patch). This has fixed the issue for me and now I am happily running > both VNET jails and VirtualBox machines on my desktop. > > But the way I fixed the issue looks hackish for me. Could someone suggest a > better solution? this is probably at east partially the correct solution. Usually you should also set the value back to its previous value when you leave that code as well. > In case someone is interested in trying this patch, below are the instructions > how to build "VIMAGE safe" vbox driver from ports: > > cd /usr/ports/emulators/virtualbox-ose-kmod > make patch > cd work > patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch > cd .. > VIMAGE=1 make > > > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org" From owner-freebsd-virtualization@FreeBSD.ORG Mon Jan 24 11:07:12 2011 Return-Path: Delivered-To: freebsd-virtualization@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C529210656AA for ; Mon, 24 Jan 2011 11:07:12 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B2A748FC08 for ; Mon, 24 Jan 2011 11:07:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p0OB7CrC077972 for ; Mon, 24 Jan 2011 11:07:12 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0OB7CiN077970 for freebsd-virtualization@FreeBSD.org; Mon, 24 Jan 2011 11:07:12 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 24 Jan 2011 11:07:12 GMT Message-Id: <201101241107.p0OB7CiN077970@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-virtualization@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-virtualization@FreeBSD.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 11:07:12 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- a kern/152047 virtualization[vimage] [panic] TUN\TAP under jail with vimage crashe o kern/148155 virtualization[vimage] Kernel panic with PF/IPFilter + VIMAGE kernel a kern/147950 virtualization[vimage] [carp] VIMAGE + CARP = kernel crash s kern/143808 virtualization[pf] pf does not work inside jail a kern/141696 virtualization[rum] [panic] rum(4)+ vimage = kernel panic 5 problems total. From owner-freebsd-virtualization@FreeBSD.ORG Tue Jan 25 21:07:00 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9180810657F0; Tue, 25 Jan 2011 21:07:00 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C03E38FC1F; Tue, 25 Jan 2011 21:06:59 +0000 (UTC) Received: by fxm16 with SMTP id 16so237834fxm.13 for ; Tue, 25 Jan 2011 13:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=/nocpxit+w7vDvB9ObYdfyfGHM+8HG/4MJxyrIgFcGU=; b=QEK0SPUYjHcbJn2VNhOoUQDD6F5WJw9SIHONXs/rH8wYk9v+KghfVyCymRdkiNSloP w2Wx6wx413ZVcDIjTV3TMtr9tduVnWwZUl+ikI6MmiQcAOpn6tICwqpilrXYb5dmbDBX zGakzSyklEiCZ4UoKAxumgcfIHbumLaTt7IHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=C03qhSeY67oO5YNMN6tZNLux9fg08FFFKCp948vKnTQGH0awSNwqVsTZv/NkcRn8yg ZWCCKZGkiwNIq9LtA1yi7UcBSRxc9PD+gxnbhaZO1LaHsGx+M0RYyf2xzkC08IDuCH7G Zz/MGb2CqP3k4z0I2c48Btv54KwSIvdpNzvoc= Received: by 10.223.86.80 with SMTP id r16mr836761fal.81.1295989618697; Tue, 25 Jan 2011 13:06:58 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id y1sm5252357fak.15.2011.01.25.13.06.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 13:06:54 -0800 (PST) From: Mikolaj Golub To: Julian Elischer References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> X-Comment-To: Julian Elischer Date: Tue, 25 Jan 2011 23:06:51 +0200 In-Reply-To: <4D3D2DE9.2060004@freebsd.org> (Julian Elischer's message of "Sun, 23 Jan 2011 23:44:41 -0800") Message-ID: <86tygwy9p0.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:07:00 -0000 --=-=-= On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the >> attached patch). This has fixed the issue for me and now I am happily running >> both VNET jails and VirtualBox machines on my desktop. >> >> But the way I fixed the issue looks hackish for me. Could someone suggest a >> better solution? JE> this is probably at east partially the correct solution. JE> Usually you should also set the value back to its previous value when JE> you leave that code as well. Thank you for the comments. Actually the patch contained CURVNET_RESTORE() too. I just did not mentioned it :-). So if it looks like right solution here is an "improved" version of the patch: vnet to switch is taken from thread's ucred (on interface initialization) or from ifp->if_vnet. >> In case someone is interested in trying this patch, below are the instructions >> how to build "VIMAGE safe" vbox driver from ports: >> >> cd /usr/ports/emulators/virtualbox-ose-kmod >> make patch >> cd work >> patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch >> cd .. >> VIMAGE=1 make >> -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=VirtualBox-3.2.12.VIMAGE.1.patch diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2011-01-25 22:48:26.000000000 +0200 @@ -26,6 +26,10 @@ CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DI CFLAGS += -DRT_ARCH_AMD64 .endif +.if defined(VIMAGE) + CFLAGS += -DVIMAGE +.endif + SRCS = \ VBoxNetFlt-freebsd.c \ VBoxNetFlt.c \ diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2011-01-25 22:48:26.000000000 +0200 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #include #include @@ -322,6 +324,7 @@ static int ng_vboxnetflt_rcvdata(hook_p struct m_tag *mtag; bool fActive; + CURVNET_SET_QUIET(ifp->if_vnet); fActive = vboxNetFltTryRetainBusyActive(pThis); NGI_GET_M(item, m); @@ -346,6 +349,7 @@ static int ng_vboxnetflt_rcvdata(hook_p ether_demux(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); @@ -363,6 +367,7 @@ static int ng_vboxnetflt_rcvdata(hook_p int rc = ether_output_frame(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return rc; } mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); @@ -377,6 +382,7 @@ static int ng_vboxnetflt_rcvdata(hook_p if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + CURVNET_RESTORE(); return (0); } @@ -409,6 +415,7 @@ static void vboxNetFltFreeBSDinput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -438,6 +445,7 @@ static void vboxNetFltFreeBSDinput(void ether_demux(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -452,6 +460,7 @@ static void vboxNetFltFreeBSDoutput(void bool fDropIt = false, fActive; PINTNETSG pSG; + CURVNET_SET_QUIET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -481,6 +490,7 @@ static void vboxNetFltFreeBSDoutput(void ether_output_frame(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + CURVNET_RESTORE(); } /** @@ -498,6 +508,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS int error; ifp = (void *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + CURVNET_SET_QUIET(ifp->if_vnet); if (fDst & INTNETTRUNKDIR_WIRE) { @@ -539,6 +550,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS m->m_pkthdr.rcvif = ifp; ifp->if_input(ifp, m); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -556,6 +568,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT node_p node; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -602,6 +615,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); vboxNetFltRelease(pThis, true /*fBusy*/); } + CURVNET_RESTORE(); return VINF_SUCCESS; } @@ -611,6 +625,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX struct ifnet *ifp, *ifp0; ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + CURVNET_SET_QUIET(ifp->if_vnet); /* * Attempt to check if the interface is still there and re-initialize if * something has changed. @@ -628,6 +643,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX vboxNetFltOsDeleteInstance(pThis); vboxNetFltOsInitInstance(pThis, NULL); } + CURVNET_RESTORE() return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); } @@ -669,6 +685,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF Log(("%s: fActive:%d\n", __func__, fActive)); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + CURVNET_SET_QUIET(ifp->if_vnet); node = (node_p)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.node); memset(&ifreq, 0, sizeof(struct ifreq)); @@ -742,6 +759,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF strlcpy(rm->ourhook, "output", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); } + CURVNET_RESTORE(); } int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) --=-=-=-- From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 02:13:59 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 830C7106566B; Wed, 26 Jan 2011 02:13:59 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 550678FC15; Wed, 26 Jan 2011 02:13:59 +0000 (UTC) Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p0Q24t4M064150 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 26 Jan 2011 02:05:07 GMT (envelope-from julian@freebsd.org) Message-ID: <4D3F8357.2070005@freebsd.org> Date: Tue, 25 Jan 2011 18:13:43 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mikolaj Golub References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> In-Reply-To: <86tygwy9p0.fsf@kopusha.home.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 02:13:59 -0000 On 1/25/11 1:06 PM, Mikolaj Golub wrote: > On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: > > JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: > > >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions > >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the > >> attached patch). This has fixed the issue for me and now I am happily running > >> both VNET jails and VirtualBox machines on my desktop. > >> > >> But the way I fixed the issue looks hackish for me. Could someone suggest a > >> better solution? > JE> this is probably at east partially the correct solution. > JE> Usually you should also set the value back to its previous value when > JE> you leave that code as well. > > Thank you for the comments. Actually the patch contained CURVNET_RESTORE() > too. I just did not mentioned it :-). So if it looks like right solution here > is an "improved" version of the patch: vnet to switch is taken from thread's > ucred (on interface initialization) or from ifp->if_vnet. yes I like it.. Now you just need a port person to patch the port :-) > >> In case someone is interested in trying this patch, below are the instructions > >> how to build "VIMAGE safe" vbox driver from ports: > >> > >> cd /usr/ports/emulators/virtualbox-ose-kmod > >> make patch > >> cd work > >> patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch > >> cd .. > >> VIMAGE=1 make > >> > From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 09:04:02 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB2D1065674; Wed, 26 Jan 2011 09:04:02 +0000 (UTC) (envelope-from fli@shapeshifter.se) Received: from mx1.h3q.net (mx1.h3q.net [IPv6:2001:16d8:ffe5:1::f1]) by mx1.freebsd.org (Postfix) with ESMTP id 8C24C8FC0A; Wed, 26 Jan 2011 09:04:02 +0000 (UTC) Received: from smtp-auth.h3q.net (smtp-auth.h3q.net [127.0.0.1]) (Authenticated sender: hidden) by mx1.h3q.net (Postfix) with ESMTPSA id D36F533C57 ; Wed, 26 Jan 2011 10:04:00 +0100 (CET) Message-ID: <4D3FE380.2020304@shapeshifter.se> Date: Wed, 26 Jan 2011 10:04:00 +0100 From: Fredrik Lindberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mikolaj Golub References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> In-Reply-To: <4D3F8357.2070005@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 26 Jan 2011 09:10:17 +0000 Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:04:02 -0000 On 01/26/2011 03:13 AM, Julian Elischer wrote: > On 1/25/11 1:06 PM, Mikolaj Golub wrote: >> On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: >> >> JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: >> >> >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" >> functions >> >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default >> vnet (see the >> >> attached patch). This has fixed the issue for me and now I am >> happily running >> >> both VNET jails and VirtualBox machines on my desktop. >> >> >> >> But the way I fixed the issue looks hackish for me. Could someone >> suggest a >> >> better solution? >> JE> this is probably at east partially the correct solution. >> JE> Usually you should also set the value back to its previous value when >> JE> you leave that code as well. >> >> Thank you for the comments. Actually the patch contained >> CURVNET_RESTORE() >> too. I just did not mentioned it :-). So if it looks like right >> solution here >> is an "improved" version of the patch: vnet to switch is taken from >> thread's >> ucred (on interface initialization) or from ifp->if_vnet. > > yes I like it.. Now you just need a port person to patch the port :-) > You should make sure it gets merged with the upstream source too. Fredrik From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 09:20:09 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DF0B1065673; Wed, 26 Jan 2011 09:20:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 80A3D8FC13; Wed, 26 Jan 2011 09:20:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 5AA9741C72F; Wed, 26 Jan 2011 10:20:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id OFad-UFQoGtt; Wed, 26 Jan 2011 10:20:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 77FBE41C72C; Wed, 26 Jan 2011 10:20:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id C2F314448F3; Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Date: Wed, 26 Jan 2011 09:15:46 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mikolaj Golub In-Reply-To: <86tygwy9p0.fsf@kopusha.home.net> Message-ID: <20110126091038.C3489@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:20:09 -0000 On Tue, 25 Jan 2011, Mikolaj Golub wrote: > > On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: > > JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: > > >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions > >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the > >> attached patch). This has fixed the issue for me and now I am happily running > >> both VNET jails and VirtualBox machines on my desktop. > >> > >> But the way I fixed the issue looks hackish for me. Could someone suggest a > >> better solution? > JE> this is probably at east partially the correct solution. > JE> Usually you should also set the value back to its previous value when > JE> you leave that code as well. > > Thank you for the comments. Actually the patch contained CURVNET_RESTORE() > too. I just did not mentioned it :-). So if it looks like right solution here > is an "improved" version of the patch: vnet to switch is taken from thread's > ucred (on interface initialization) or from ifp->if_vnet. > > >> In case someone is interested in trying this patch, below are the instructions > >> how to build "VIMAGE safe" vbox driver from ports: > >> > >> cd /usr/ports/emulators/virtualbox-ose-kmod > >> make patch > >> cd work > >> patch -p0< /path/to/VirtualBox-3.2.12.VIMAGE.patch > >> cd .. > >> VIMAGE=1 make I think you should wrap the CURVNET changes in __FreeBSD_version checks so that the port, should it run elsewhere or on older FreeBSDs (if it runs there) not trouble people having to patch it away. #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 #endif might be a save bet. /bz -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 09:37:48 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86AB41065787; Wed, 26 Jan 2011 09:37:48 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from groupware.itac.at (groupware.itac.at [91.205.172.99]) by mx1.freebsd.org (Postfix) with ESMTP id E52FB8FC1F; Wed, 26 Jan 2011 09:37:46 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 2FD27A; Wed, 26 Jan 2011 10:24:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Wed, 26 Jan 2011 10:22:40 +0100 From: Bernhard Froehlich To: Julian Elischer In-Reply-To: <4D3F8357.2070005@freebsd.org> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> Message-ID: <62fcd16074e526547c3417a8f259174e@bluelife.at> X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5-rc X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0205.4D3FE7DF.02A9,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-Mailman-Approved-At: Wed, 26 Jan 2011 09:43:22 +0000 Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:37:48 -0000 On Tue, 25 Jan 2011 18:13:43 -0800, Julian Elischer wrote: > On 1/25/11 1:06 PM, Mikolaj Golub wrote: >> On Sun, 23 Jan 2011 23:44:41 -0800 Julian Elischer wrote: >> >> JE> On 1/23/11 6:33 AM, Mikolaj Golub wrote: >> >> >> As a quick fix I added in VBoxNetFlt-freebsd.c in all "problem" functions >> >> CURVNET_SET_QUIET(vnet0) macro, which sets td->td_vnet to default vnet (see the >> >> attached patch). This has fixed the issue for me and now I am happily running >> >> both VNET jails and VirtualBox machines on my desktop. >> >> >> >> But the way I fixed the issue looks hackish for me. Could someone suggest a >> >> better solution? >> JE> this is probably at east partially the correct solution. >> JE> Usually you should also set the value back to its previous value when >> JE> you leave that code as well. >> >> Thank you for the comments. Actually the patch contained CURVNET_RESTORE() >> too. I just did not mentioned it :-). So if it looks like right solution here >> is an "improved" version of the patch: vnet to switch is taken from thread's >> ucred (on interface initialization) or from ifp->if_vnet. > > yes I like it.. Now you just need a port person to patch the port :-) Sounds like it's my turn now. Which FreeBSD version is required to be able to use it? Is VIMAGE enabled per default and what happens if VIMAGE is disabled - does it at least build fine with that patch? For Mikolaj Golub to get this patch upstream we need that you either agree that his patch is under the MIT License or sign a Sun Contributors Agreement. Then we can submit that patch upstream or you can do it yourself if you prefer. Read here: http://www.virtualbox.org/wiki/Contributor_information -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 14:04:24 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C440F106564A; Wed, 26 Jan 2011 14:04:24 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 271BF8FC23; Wed, 26 Jan 2011 14:04:23 +0000 (UTC) Received: by fxm16 with SMTP id 16so1069236fxm.13 for ; Wed, 26 Jan 2011 06:04:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=1I5TNmDans07HCiUJ3lfP9vUV+xtcKpH7h86Z3g/Ag0=; b=Qar92HIpDKIBhHNx8a/Mn4ESgdmnHOCuYQWf/2iZjnbcA4E5qC80O8CPSlDdRJzPML wtOuMBUvvwrxlMNDEgWWNyLImw9vebXyen5kfa9sbQXQjLD/tlM4bA6r2oxDJD8KoEPl 3EcDvMsIR0oHo0PBddZr2/Hwj5vZVdFlVUlPE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=wQereZhKbc6mlGZ4Dy4lE25JzYhhVg8Dv7iFaM9XZSUz/miFD9/h21PfOIbbM9FqoT Kw2LlkZ9hbRBzFuy84Zqs49uO8aX1O6yvV58F2bNU7xvqbso0NPrm7hg814q05pc7Wah TpWY4/WWTg6vhSg2J2k3b++fqiqq6m5B0EHLo= Received: by 10.223.78.205 with SMTP id m13mr7293665fak.79.1296050662831; Wed, 26 Jan 2011 06:04:22 -0800 (PST) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id b7sm5514154faa.18.2011.01.26.06.04.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 06:04:18 -0800 (PST) From: Mikolaj Golub To: "Bjoern A. Zeeb" Organization: TOA Ukraine References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> Date: Wed, 26 Jan 2011 16:04:16 +0200 In-Reply-To: <20110126091038.C3489@maildrop.int.zabbadoz.net> (Bjoern A. Zeeb's message of "Wed, 26 Jan 2011 09:15:46 +0000 (UTC)") Message-ID: <86aainkbhb.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:04:25 -0000 --=-=-= On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs BAZ> (if it runs there) not trouble people having to patch it away. BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 BAZ> #endif BAZ> might be a save bet. Thanks. Something like in the patch below? Note, I have not run this version yet. Will test it tonight or tomorrow. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=VirtualBox-3.2.12.VIMAGE.2.patch diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile 2011-01-26 15:47:27.000000000 +0200 @@ -26,6 +26,10 @@ CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DI CFLAGS += -DRT_ARCH_AMD64 .endif +.if defined(VIMAGE) + CFLAGS += -DVIMAGE +.endif + SRCS = \ VBoxNetFlt-freebsd.c \ VBoxNetFlt.c \ diff -rpu VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c --- VirtualBox-3.2.12_OSE.orig/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2010-12-01 19:09:33.000000000 +0200 +++ VirtualBox-3.2.12_OSE/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2011-01-26 15:56:41.000000000 +0200 @@ -97,6 +97,21 @@ static int ng_vboxnetflt_mod_even /** mbuf packet tag */ #define PACKET_TAG_VBOX 128 +#if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 +#include +#include + +#define VBOXCURVNET_SET(arg) CURVNET_SET_QUIET(arg) +#define VBOXCURVNET_SET_FROM_UCRED() VBOXCURVNET_SET(CRED_TO_VNET(curthread->td_ucred)) +#define VBOXCURVNET_RESTORE() CURVNET_RESTORE() + +#else + +#define VBOXCURVNET_SET(arg) +#define VBOXCURVNET_SET_FROM_UCRED() +#define VBOXCURVNET_RESTORE() +#endif + /* * Netgraph command list, we don't support any * additional commands. @@ -322,6 +337,7 @@ static int ng_vboxnetflt_rcvdata(hook_p struct m_tag *mtag; bool fActive; + VBOXCURVNET_SET(ifp->if_vnet); fActive = vboxNetFltTryRetainBusyActive(pThis); NGI_GET_M(item, m); @@ -346,6 +362,7 @@ static int ng_vboxnetflt_rcvdata(hook_p ether_demux(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); return (0); } mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); @@ -363,6 +380,7 @@ static int ng_vboxnetflt_rcvdata(hook_p int rc = ether_output_frame(ifp, m); if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); return rc; } mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); @@ -377,6 +395,7 @@ static int ng_vboxnetflt_rcvdata(hook_p if (fActive) vboxNetFltRelease(pThis, true /*fBusy*/); + VBOXCURVNET_RESTORE(); return (0); } @@ -409,6 +428,7 @@ static void vboxNetFltFreeBSDinput(void bool fDropIt = false, fActive; PINTNETSG pSG; + VBOXCURVNET_SET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -438,6 +458,7 @@ static void vboxNetFltFreeBSDinput(void ether_demux(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + VBOXCURVNET_RESTORE(); } /** @@ -452,6 +473,7 @@ static void vboxNetFltFreeBSDoutput(void bool fDropIt = false, fActive; PINTNETSG pSG; + VBOXCURVNET_SET(ifp->if_vnet); vboxNetFltRetain(pThis, true /* fBusy */); for (;;) { @@ -481,6 +503,7 @@ static void vboxNetFltFreeBSDoutput(void ether_output_frame(ifp, m); } vboxNetFltRelease(pThis, true /* fBusy */); + VBOXCURVNET_RESTORE(); } /** @@ -498,6 +521,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS int error; ifp = (void *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + VBOXCURVNET_SET(ifp->if_vnet); if (fDst & INTNETTRUNKDIR_WIRE) { @@ -539,6 +563,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS m->m_pkthdr.rcvif = ifp; ifp->if_input(ifp, m); } + VBOXCURVNET_RESTORE(); return VINF_SUCCESS; } @@ -556,6 +581,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT node_p node; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; + VBOXCURVNET_SET_FROM_UCRED(); NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -602,6 +628,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLT pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); vboxNetFltRelease(pThis, true /*fBusy*/); } + VBOXCURVNET_RESTORE(); return VINF_SUCCESS; } @@ -611,6 +638,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX struct ifnet *ifp, *ifp0; ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + VBOXCURVNET_SET(ifp->if_vnet); /* * Attempt to check if the interface is still there and re-initialize if * something has changed. @@ -628,6 +656,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX vboxNetFltOsDeleteInstance(pThis); vboxNetFltOsInitInstance(pThis, NULL); } + VBOXCURVNET_RESTORE() return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); } @@ -669,6 +698,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF Log(("%s: fActive:%d\n", __func__, fActive)); ifp = (struct ifnet *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.ifp); + VBOXCURVNET_SET(ifp->if_vnet); node = (node_p)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.node); memset(&ifreq, 0, sizeof(struct ifreq)); @@ -742,6 +772,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETF strlcpy(rm->ourhook, "output", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); } + VBOXCURVNET_RESTORE(); } int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) --=-=-=-- From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 14:20:06 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCA89106564A; Wed, 26 Jan 2011 14:20:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 7022D8FC1C; Wed, 26 Jan 2011 14:20:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id CB66241C6F2; Wed, 26 Jan 2011 15:20:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id aae-Mn4ReFSq; Wed, 26 Jan 2011 15:20:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 72D2741C6A7; Wed, 26 Jan 2011 15:20:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 309484448F3; Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Date: Wed, 26 Jan 2011 14:18:03 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mikolaj Golub In-Reply-To: <86aainkbhb.fsf@zhuzha.ua1> Message-ID: <20110126141636.D3489@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:20:06 -0000 On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: > > BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version > BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs > BAZ> (if it runs there) not trouble people having to patch it away. > > BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 > BAZ> #endif > > BAZ> might be a save bet. > > Thanks. Something like in the patch below? > > Note, I have not run this version yet. Will test it tonight or tomorrow. Well, you will need to include as well, and that only if you are on FreeBSD so you'll need an extra check for just that I guess. Not sure how vbox handles the all this in their guts. /bz -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 14:25:59 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F1D2106566B; Wed, 26 Jan 2011 14:25:59 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D32888FC14; Wed, 26 Jan 2011 14:25:58 +0000 (UTC) Received: by fxm16 with SMTP id 16so1089305fxm.13 for ; Wed, 26 Jan 2011 06:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=AtZ/NahZMeHDXv6oYdbU7L+jDGIYW1y0I56fpzyVyAA=; b=JaZz5291VwR4VZ3KlLc3nmLZma0ZUut13LPfCVDlYNdl6jF6q7dtnZfVffkgQ58F7C FDYakOhQpAwXVHxnO6MaB0uF4SWrEvNVQdRX7HNNTl96Q3Xr5lE8tXEeBxJd3j1rMElC MysjUJA6xKiyOpw6/E4QP3GU+iCuDCIlt8+Ac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=KKobyX3uDfTHUwR7xMv5xGA4aHhxuQLoXinq4s7Mt3a6s85lJuQ9r2mRC+PbZd78s/ OZQtUkuMvoV23BkRiBsNNkBvFp3XEkl01gFVDh0mJpcif282tBu0cwBRb0XsB0KouVeI geTu3zi3Q7Rq27nj3lsNnI9Sev9ipWCI1APss= Received: by 10.223.83.11 with SMTP id d11mr7284374fal.37.1296051932203; Wed, 26 Jan 2011 06:25:32 -0800 (PST) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id f24sm5523671fak.24.2011.01.26.06.25.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 06:25:30 -0800 (PST) From: Mikolaj Golub To: Bernhard Froehlich Organization: TOA Ukraine References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> Date: Wed, 26 Jan 2011 16:25:28 +0200 In-Reply-To: <62fcd16074e526547c3417a8f259174e@bluelife.at> (Bernhard Froehlich's message of "Wed, 26 Jan 2011 10:22:40 +0100") Message-ID: <8662tbkahz.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:25:59 -0000 On Wed, 26 Jan 2011 10:22:40 +0100 Bernhard Froehlich wrote: BF> Sounds like it's my turn now. Which FreeBSD version is required to be BF> able to use it? As Bjoern noted it is for __FreeBSD_version >= 800500. BF> Is VIMAGE enabled per default and what happens if VIMAGE is disabled - BF> does it at least build fine with that patch? We have VIMAGE disabled by default. I have added to src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile: .if defined(VIMAGE) CFLAGS += -DVIMAGE .endif So to build the driver for VIMAGE enabled kernel one should run VIMAGE=1 make If VIMAGE variable is not defined the module for VIMAGE disabled kernel will be built. I am not familiar with VBox build process so there might be a better solution. I suppose we should have an option in ports, something: .if ${OSVERSION} < 800500 OPTIONS+= VIMAGE "Build for VIMAGE kernel" off .endif and if it is on set VIMAGE make environment variable. Or may be you have a better solution. BF> For Mikolaj Golub to get this patch upstream we need that you either BF> agree that his patch is under the MIT License or sign a Sun Contributors BF> Agreement. Then we can submit that patch upstream or you can do it BF> yourself if you prefer. Read here: BF> http://www.virtualbox.org/wiki/Contributor_information MIT License is ok. It would be very nice of you if you submitted the patch upstream :-). If nobody do this then I will try to submit it myself. -- Mikolaj Golub From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 14:31:44 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B264106566B; Wed, 26 Jan 2011 14:31:44 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id CD4F58FC12; Wed, 26 Jan 2011 14:31:43 +0000 (UTC) Received: by wyf19 with SMTP id 19so975661wyf.13 for ; Wed, 26 Jan 2011 06:31:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=I9GsuLScg2d25gl5bBq9ykfKYKtebZ2m6htucFmjCfA=; b=BecvcSCUR9l7IEmpdgJb8z6GcXTQ1+H1TV3RcI0C6bSPNgWLKBIydLEMQOGWEtm79X sCFJo+7T4t5FNq05xEI2dabgxYKbbyf82/kh9p51S3/++pIAKohHRKLUUtDgkVq2NFNa PNMIEnnkRXHWonq382j2ZWHa1EB21AvhcxhI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=D667OfElYhZ6pcNOqxT4daq9xLN1/VfGcswRwq+Y+nCWt+H3MKp4ZKksnVWv7i4D6M 8cIrIwezz1/hhjRDt4BdmGalS5sKLqXDiV5qXXEM728ZfWv9ovhfyj5lz/p7tnTSrBW2 8T4OG/1lYCVy/5+ZXgYMOnekgkr5vZmul7kJ8= MIME-Version: 1.0 Received: by 10.216.73.203 with SMTP id v53mr526229wed.48.1296052302356; Wed, 26 Jan 2011 06:31:42 -0800 (PST) Received: by 10.216.36.71 with HTTP; Wed, 26 Jan 2011 06:31:42 -0800 (PST) In-Reply-To: <8662tbkahz.fsf@zhuzha.ua1> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> Date: Wed, 26 Jan 2011 08:31:42 -0600 Message-ID: From: Brandon Gooch To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-emulation@freebsd.org, Bernhard Froehlich , freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:31:44 -0000 On Wed, Jan 26, 2011 at 8:25 AM, Mikolaj Golub wr= ote: [SNIP] > I suppose we should have an option in ports, something: > > .if ${OSVERSION} < 800500 > OPTIONS+=3D =A0 =A0 =A0 =A0VIMAGE "Build for VIMAGE kernel" off > .endif > > and if it is on set VIMAGE make environment variable. Or may be you have > a better solution. As of r217203 on 9-CURRENT and r217403 on 8-STABLE, VIMAGE is announced as a feature via sysctl(8). Would it be possible to query this value to decide how to build the module? [SNIP] -Brandon From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 14:45:07 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD6081065675; Wed, 26 Jan 2011 14:45:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 70DB58FC19; Wed, 26 Jan 2011 14:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 71D3741C730; Wed, 26 Jan 2011 15:45:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id KR3cmD5L2fNl; Wed, 26 Jan 2011 15:45:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 9118841C705; Wed, 26 Jan 2011 15:45:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id C8047444936; Wed, 26 Jan 2011 14:40:18 +0000 (UTC) Date: Wed, 26 Jan 2011 14:40:18 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Brandon Gooch In-Reply-To: Message-ID: <20110126143845.K3489@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1417997109-1296052818=:3489" Cc: freebsd-emulation@freebsd.org, Bernhard Froehlich , FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:45:07 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1417997109-1296052818=:3489 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 26 Jan 2011, Brandon Gooch wrote: > On Wed, Jan 26, 2011 at 8:25 AM, Mikolaj Golub = wrote: > > [SNIP] > >> I suppose we should have an option in ports, something: >> >> .if ${OSVERSION} < 800500 >> OPTIONS+=3D =A0 =A0 =A0 =A0VIMAGE "Build for VIMAGE kernel" off >> .endif >> >> and if it is on set VIMAGE make environment variable. Or may be you have >> a better solution. > > As of r217203 on 9-CURRENT and r217403 on 8-STABLE, VIMAGE is > announced as a feature via sysctl(8). Would it be possible to query > this value to decide how to build the module? It would but still leave you with problems on earlier freebsd versions or if you are building for another machine. /bz --=20 Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html --0-1417997109-1296052818=:3489-- From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 21:27:33 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEAC9106566B; Wed, 26 Jan 2011 21:27:33 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 550858FC17; Wed, 26 Jan 2011 21:27:32 +0000 (UTC) Received: by fxm16 with SMTP id 16so1499138fxm.13 for ; Wed, 26 Jan 2011 13:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=F+M6whwBSCbr/xIyy9MZrH1ZdqNg0U6NVxl+eWO67zA=; b=sc6i6CSCb2iuFRziZqJJqxaY2GU+weeS7r9hyytLmeCDGoeARo2cP7VVvFwqrgu4AA tsFH584pNmH2bpXzJJ+ocF7mn2+u0HP8rUha2OMqEZA0Vg7OOGrlwPx1LgjtRCuv43j/ imsRQKdbX4bPz0796Wl8Zh/sdax+rS/9ojjzA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=fSC8Y8ZwkGNswp1FYWZFuy27j/PQ3R3Mj6Xdf2DW1K/EN5icREVSpq4l75ExQnaBBv OwUkRRLlVMVaIrS7hlHRYb2ryJBvbul6s2BmJb43Km44IOGBJ6y2BRyvZ6ql3Qz/FefE IinoKU/p+k/8sJdlfW6T5YDjk+m8DvQ21Iccg= Received: by 10.223.86.16 with SMTP id q16mr14663fal.58.1296077251931; Wed, 26 Jan 2011 13:27:31 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id n26sm5726584fam.37.2011.01.26.13.27.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 13:27:29 -0800 (PST) From: Mikolaj Golub To: "Bjoern A. Zeeb" References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> X-Comment-To: Bjoern A. Zeeb Date: Wed, 26 Jan 2011 23:27:27 +0200 In-Reply-To: <20110126141636.D3489@maildrop.int.zabbadoz.net> (Bjoern A. Zeeb's message of "Wed, 26 Jan 2011 14:18:03 +0000 (UTC)") Message-ID: <86ei7z4aps.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:27:34 -0000 On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: >> >> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: >> >> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version >> BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs >> BAZ> (if it runs there) not trouble people having to patch it away. >> >> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 >> BAZ> #endif >> >> BAZ> might be a save bet. >> >> Thanks. Something like in the patch below? >> >> Note, I have not run this version yet. Will test it tonight or tomorrow. BAZ> Well, you will need to include as well, and that only if BAZ> you are on FreeBSD so you'll need an extra check for just that I BAZ> guess. Not sure how vbox handles the all this in their guts. The file has already had '#include ' among other includes. It just is not seen in the patch. The file is used only for FreeBSD driver so there is no need in extra check I think. I have tested this latest version of the patch. It works for me. -- Mikolaj Golub From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 21:55:07 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBA83106566B; Wed, 26 Jan 2011 21:55:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 40BB08FC0C; Wed, 26 Jan 2011 21:55:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4450341C798; Wed, 26 Jan 2011 22:55:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id EWL8XKftWEY7; Wed, 26 Jan 2011 22:55:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id AE4EB41C7A9; Wed, 26 Jan 2011 22:55:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 4354B4448F3; Wed, 26 Jan 2011 21:51:18 +0000 (UTC) Date: Wed, 26 Jan 2011 21:51:18 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mikolaj Golub In-Reply-To: <86ei7z4aps.fsf@kopusha.home.net> Message-ID: <20110126215009.T39951@maildrop.int.zabbadoz.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <20110126091038.C3489@maildrop.int.zabbadoz.net> <86aainkbhb.fsf@zhuzha.ua1> <20110126141636.D3489@maildrop.int.zabbadoz.net> <86ei7z4aps.fsf@kopusha.home.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:55:07 -0000 On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > On Wed, 26 Jan 2011 14:18:03 +0000 (UTC) Bjoern A. Zeeb wrote: > > BAZ> On Wed, 26 Jan 2011, Mikolaj Golub wrote: > > >> > >> On Wed, 26 Jan 2011 09:15:46 +0000 (UTC) Bjoern A. Zeeb wrote: > >> > >> BAZ> I think you should wrap the CURVNET changes in __FreeBSD_version > >> BAZ> checks so that the port, should it run elsewhere or on older FreeBSDs > >> BAZ> (if it runs there) not trouble people having to patch it away. > >> > >> BAZ> #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 > >> BAZ> #endif > >> > >> BAZ> might be a save bet. > >> > >> Thanks. Something like in the patch below? > >> > >> Note, I have not run this version yet. Will test it tonight or tomorrow. > > BAZ> Well, you will need to include as well, and that only if > BAZ> you are on FreeBSD so you'll need an extra check for just that I > BAZ> guess. Not sure how vbox handles the all this in their guts. > > The file has already had '#include ' among other includes. It > just is not seen in the patch. The file is used only for FreeBSD driver so > there is no need in extra check I think. Ok, if it's freebsd only, then what you had was fine. > I have tested this latest version of the patch. It works for me. Cool. Thanks! -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 26 23:19:58 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 408C0106566B; Wed, 26 Jan 2011 23:19:58 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from groupware.itac.at (groupware.itac.at [91.205.172.99]) by mx1.freebsd.org (Postfix) with ESMTP id C5E6E8FC08; Wed, 26 Jan 2011 23:19:57 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 14BA37; Thu, 27 Jan 2011 00:22:01 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Thu, 27 Jan 2011 00:19:57 +0100 From: Bernhard Froehlich To: Mikolaj Golub In-Reply-To: <8662tbkahz.fsf@zhuzha.ua1> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> Message-ID: X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.5-rc X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B0202.4D40AC1C.00A2,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-Mailman-Approved-At: Wed, 26 Jan 2011 23:23:04 +0000 Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 23:19:58 -0000 On Wed, 26 Jan 2011 16:25:28 +0200, Mikolaj Golub wrote: > On Wed, 26 Jan 2011 10:22:40 +0100 Bernhard Froehlich wrote: > > BF> Sounds like it's my turn now. Which FreeBSD version is required to be > BF> able to use it? > > As Bjoern noted it is for __FreeBSD_version >= 800500. > > BF> Is VIMAGE enabled per default and what happens if VIMAGE is disabled - > BF> does it at least build fine with that patch? > > We have VIMAGE disabled by default. > > I have added to src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile: > > .if defined(VIMAGE) > CFLAGS += -DVIMAGE > .endif > > So to build the driver for VIMAGE enabled kernel one should run > > VIMAGE=1 make > > If VIMAGE variable is not defined the module for VIMAGE disabled kernel will > be built. http://home.bluelife.at/patches/virtualbox-ose-kmod-devel-VIMAGE.diff I've integrated it a bit better into the VirtualBox build system, added the ports stuff and updated the patch for VirtualBox 4.0.2. It is currently unclear to me why you add VIMAGE to CFLAGS but nowhere check for VIMAGE in VBoxNetFlt-freebsd.c. Shouldn't we add a check for VIMAGE in the #if defined line or is this already done somewhere deep in the included headers? -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-virtualization@FreeBSD.ORG Thu Jan 27 11:57:25 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE17C106564A; Thu, 27 Jan 2011 11:57:25 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 051458FC16; Thu, 27 Jan 2011 11:57:24 +0000 (UTC) Received: by fxm16 with SMTP id 16so2171986fxm.13 for ; Thu, 27 Jan 2011 03:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=g4opZijcveMX3Ti4ApMoUszrloilRLnGXuXOvjYhIgM=; b=VknrAv4+uAxsRuE3y4MSLPgh7UnBngsJNdFuEkNN/g0EQMCwD7uL4bfDBIBED9jVaM Ke0+oua5VbEQaodYFzS3KnFTy1PnAZ3OHrpmG45mrsiJs2Qe9gtKxNPon56HcA/zscCI aKbBi5SXwcxsJQSZXiRj46IIdF0uRRG2Kcw3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=TJfJRHk7nE/kl1i7ArLtOOw/4feHO7Z5CHsSMa6iW0US1i16cY+n3v0dArGir6xV0s aVxwvLv5XaJ6gX0tQAPKDl3L2RGSzSqwbctFXWsIlwjE3wHGqy/0rUldePmwqjI+IHgV LisGoa7mzazvgijpqqzzH/cU3NeWKsE8MQZyU= Received: by 10.223.86.140 with SMTP id s12mr787631fal.145.1296129442698; Thu, 27 Jan 2011 03:57:22 -0800 (PST) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id 21sm5933406fav.17.2011.01.27.03.57.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 Jan 2011 03:57:20 -0800 (PST) From: Mikolaj Golub To: Bernhard Froehlich Organization: TOA Ukraine References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net> <4D3F8357.2070005@freebsd.org> <62fcd16074e526547c3417a8f259174e@bluelife.at> <8662tbkahz.fsf@zhuzha.ua1> Date: Thu, 27 Jan 2011 13:57:16 +0200 In-Reply-To: (Bernhard Froehlich's message of "Thu, 27 Jan 2011 00:19:57 +0100") Message-ID: <861v3yk19f.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, freebsd-virtualization@freebsd.org Subject: Re: VirtualBox + VIMAGE X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 11:57:26 -0000 On Thu, 27 Jan 2011 00:19:57 +0100 Bernhard Froehlich wrote: BF> http://home.bluelife.at/patches/virtualbox-ose-kmod-devel-VIMAGE.diff BF> I've integrated it a bit better into the VirtualBox build system, added BF> the ports stuff and updated the patch for VirtualBox 4.0.2. Thanks! BF> It is currently unclear to me why you add VIMAGE to CFLAGS but nowhere BF> check for VIMAGE in VBoxNetFlt-freebsd.c. Shouldn't we add a check for BF> VIMAGE in the #if defined line or is this already done somewhere deep in BF> the included headers? All magic is in net/vnet.h :-) -- Mikolaj Golub