From owner-freebsd-virtualization@FreeBSD.ORG Sun Jan 9 20:50:08 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 E11E010656A9 for ; Sun, 9 Jan 2011 20:50:08 +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 5D5EB8FC17 for ; Sun, 9 Jan 2011 20:50:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 8C6AC41C7A3; Sun, 9 Jan 2011 21:50: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 hRh3C+dQNL9p; Sun, 9 Jan 2011 21:50:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id DF5B441C7AB; Sun, 9 Jan 2011 21:50: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 D3DB14448F3; Sun, 9 Jan 2011 20:46:44 +0000 (UTC) Date: Sun, 9 Jan 2011 20:46:44 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Brandon Gooch In-Reply-To: <20110109171351.I14966@maildrop.int.zabbadoz.net> Message-ID: <20110109204617.C14966@maildrop.int.zabbadoz.net> References: <20110109171351.I14966@maildrop.int.zabbadoz.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1607528239-1294606004=:14966" Cc: FreeBSD virtualization mailing list Subject: Re: way for determine VIMAGE feature 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, 09 Jan 2011 20:50:09 -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-1607528239-1294606004=:14966 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 9 Jan 2011, Bjoern A. Zeeb wrote: > On Sun, 9 Jan 2011, Brandon Gooch wrote: > >> On Sun, Jan 9, 2011 at 9:17 AM, Subbsd wrote: >>> Hi >>>=20 >>> is there any mechanism to find out from userland =A0is supports the >>> current kernel VIMAGE or not? something like 'sysctl >>> kern.features.vnet=3D1' ? >>> Thanks >>=20 >> I've not been able to determine this either, but as it requires kernel >> re-configuration, I usually just know. In my scripts, I make sure and >> fail if the call to create a vnet jail fails: >>=20 >> sh -c 'TEST=3D$(sudo jail -c vnet name=3Dtest host.hostname=3Dtest path= =3D/) ; >> if [ $? =3D "1" ]; then echo "VIMAGE NOT AVAILABLE" ; exit 1 ; fi' > > I would just go with jail -c vnet command=3D/usr/bin/true or something > along these liens for the pure test. Otherwise you might end up with > a running jail, that you may not want unless you test it with the > complete command line. > > >> ...or something like that. >>=20 >> There may be a better way, or perhaps there should be. > > Or there will be if there isn't yet. I remember I added a FEATURE() > macro somehere. At least my dev machine already has it... > > # sysctl -a kern.features > kern.features.compat_freebsd7: 1 > kern.features.compat_freebsd6: 1 > kern.features.compat_freebsd5: 1 > kern.features.compat_freebsd4: 1 > kern.features.vimage: 1=09=09=09<<< > kern.features.posix_shm: 1 > kern.features.ipsec_natt: 1 > kern.features.ipsec: 1 ------------------------------------------------------------------------ Author: bz Date: Sun Jan 9 20:40:21 2011 New Revision: 217203 URL: http://svn.freebsd.org/changeset/base/217203 Log: MfP4 CH=3D185246 [1]: Add FEATURE() to announce optional VIMAGE. MFC after: 3 days [1] for the moment put it in vnet.c. Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sys/net/vnet.c Sun Jan 9 17:40:04 2011 (r217202) +++ head/sys/net/vnet.c Sun Jan 9 20:40:21 2011 (r217203) @@ -80,6 +80,8 @@ __FBSDID("$FreeBSD$"); * stack instance. */ +FEATURE(vimage, "VIMAGE kernel virtualization"); + MALLOC_DEFINE(M_VNET, "vnet", "network stack control block"); /* ------------------------------------------------------------------------ --=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-1607528239-1294606004=:14966--