Date: Wed, 26 Jan 2011 09:15:46 +0000 (UTC) From: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> To: Mikolaj Golub <to.my.trociny@gmail.com> Cc: freebsd-emulation@freebsd.org, FreeBSD virtualization mailing list <freebsd-virtualization@freebsd.org> Subject: Re: VirtualBox + VIMAGE Message-ID: <20110126091038.C3489@maildrop.int.zabbadoz.net> In-Reply-To: <86tygwy9p0.fsf@kopusha.home.net> References: <86oc77heqk.fsf@kopusha.home.net> <4D3D2DE9.2060004@freebsd.org> <86tygwy9p0.fsf@kopusha.home.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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! <ks> Going to jail sucks -- <bz> All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110126091038.C3489>