From owner-freebsd-virtualization@FreeBSD.ORG Tue Mar 16 15:20:08 2010 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 7BC741065672 for ; Tue, 16 Mar 2010 15:20: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 114718FC18 for ; Tue, 16 Mar 2010 15:20:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4C7E841C69F; Tue, 16 Mar 2010 16:20: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 e23Zd-P+gN12; Tue, 16 Mar 2010 16:20:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 619E641C6B4; Tue, 16 Mar 2010 16: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 0455A4448EC; Tue, 16 Mar 2010 15:15:43 +0000 (UTC) Date: Tue, 16 Mar 2010 15:15:43 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Milan Obuch In-Reply-To: <201003161529.33273.freebsd-virtualization@dino.sk> Message-ID: <20100316151427.U33454@maildrop.int.zabbadoz.net> References: <201003161455.43783.freebsd-virtualization@dino.sk> <201003161529.33273.freebsd-virtualization@dino.sk> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD virtualization mailing list Subject: Re: shmget and 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, 16 Mar 2010 15:20:08 -0000 On Tue, 16 Mar 2010, Milan Obuch wrote: > On Tuesday 16 March 2010 14:55:43 Milan Obuch wrote: >> Hi, >> >> some time ago I built a multi network monitor using older version with >> Marko Zec's vimage patch. I am trying to port it to 8-STABLE (newer >> features, easier maintenance...) with partial success. >> >> Basically, I use shared memory as common data area across more vimages in >> order to be able to generate quick summaries from in-memory data. I was not >> able to get it running under freshly compiler 8-STABLE, error message is >> >> shmget: Function not implemented >> >> Has anybody any idea? Patch to test to enable use of shared memory in vnet >> jails? >> >> Regards, >> Milan >> > > Forget to add... > > In my code, I use > > if ((shmid = shmget(shmkey,sizeof(mdc),IPC_CREAT | 0640)) == -1) > err(1,"shmget"); > > to create a shared segment and > > if ((shmid = shmget(shmkey,sizeof(mdc),0)) == -1) > err(1,"shmget"); > > to get an id for already created segment. > > Both are failing under non-root vimage jail, but it works under main host. At > first I thought shared memory is not yet virtualized, but ipcs display > existing segments in both root/main host and vnet jail.ipcrm, however, works > only in non-jailed host... > > ipcrm: shmid(131072): : Function not implemented if you create a jail with a vnet you want to give it jail - i -c vnet allow.sysvipc .. and then things should start to work at leat in the non-virtualized way (global namespace across all jails). /bz -- Bjoern A. Zeeb It will not break if you know what you are doing.