Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Adrian Penisoara
Hi, Since we're going to see VIMAGE (partly) committed into HEAD anytime now, perhaps it would be a good time to make available some clear developer documentation on how to cope with VIMAGE in the kernel (at kernel build time or building a module separately). 3rd party driver vendors will be mos

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Bjoern A. Zeeb
On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: On Thu, Feb 3, 2011 at 12:18 PM, Bjoern A. Zeeb wrote: On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: On Thu, Feb 3, 2011 at 11:59 AM, Bjoern A. Zeeb wrote: On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: I don't understand why you saw a CRE

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Julian Elischer
On 2/3/11 2:59 AM, Bjoern A. Zeeb wrote: On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: I don't understand why you saw a CRED_TO_VNET of 0 I was under the impression that every process/thread in the system would be on vnet0 in a vimage kernel. This is how my printf looks like: struct thread

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Monthadar Al Jaberi
On Thu, Feb 3, 2011 at 12:18 PM, Bjoern A. Zeeb wrote: > On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: > >> On Thu, Feb 3, 2011 at 11:59 AM, Bjoern A. Zeeb >> wrote: >>> >>> On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: >>> >>> I don't understand why you saw a CRED_TO_VNET of 0 >>> I wa

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Bjoern A. Zeeb
On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: On Thu, Feb 3, 2011 at 11:59 AM, Bjoern A. Zeeb wrote: On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: I don't understand why you saw a CRED_TO_VNET of 0 I was under the impression that every process/thread in the system would be on vnet0 in a vi

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Monthadar Al Jaberi
On Thu, Feb 3, 2011 at 11:59 AM, Bjoern A. Zeeb wrote: > On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: > > I don't understand why you saw a CRED_TO_VNET of 0 > I was under the impression that every process/thread in the system > would > be > on vnet0 > in a vimage kernel.

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Bjoern A. Zeeb
On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: I don't understand why you saw a CRED_TO_VNET of 0 I was under the impression that every process/thread in the system would be on vnet0 in a vimage kernel. This is how my printf looks like: struct thread *td = curthread; struct vnet *v = TD_TO_VNE

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Monthadar Al Jaberi
On Thu, Feb 3, 2011 at 10:55 AM, Bjoern A. Zeeb wrote: > On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: > >> On Wed, Feb 2, 2011 at 8:06 PM, Julian Elischer >> wrote: >>> >>> On 2/2/11 10:05 AM, Monthadar Al Jaberi wrote: I just tried something that seems to work, but please dont hit me

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Bjoern A. Zeeb
On Thu, 3 Feb 2011, Monthadar Al Jaberi wrote: On Wed, Feb 2, 2011 at 8:06 PM, Julian Elischer wrote: On 2/2/11 10:05 AM, Monthadar Al Jaberi wrote: I just tried something that seems to work, but please dont hit me ^^;;; in wtap_ioctl I assigned curthread->td_vnet myself to point to a VNET

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-03 Thread Monthadar Al Jaberi
On Wed, Feb 2, 2011 at 8:06 PM, Julian Elischer wrote: > On 2/2/11 10:05 AM, Monthadar Al Jaberi wrote: >> >> I just tried something that seems to work, but please dont hit me ^^;;; >> >> in wtap_ioctl I assigned curthread->td_vnet myself to point to a VNET >> (saved it when the module first loade

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Julian Elischer
On 2/2/11 10:05 AM, Monthadar Al Jaberi wrote: I just tried something that seems to work, but please dont hit me ^^;;; in wtap_ioctl I assigned curthread->td_vnet myself to point to a VNET (saved it when the module first loaded) (I have not created any jails yet)... and it works... I didnt put a

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Monthadar Al Jaberi
I just tried something that seems to work, but please dont hit me ^^;;; in wtap_ioctl I assigned curthread->td_vnet myself to point to a VNET (saved it when the module first loaded) (I have not created any jails yet)... and it works... I didnt put any CURVNET macros... my assumption is that if at

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Julian Elischer
On 2/2/11 9:12 AM, Bjoern A. Zeeb wrote: On Wed, 2 Feb 2011, Monthadar Al Jaberi wrote: Hi, Thanx makes more sense, but I have noticed something weired if you can shade some light on. I added printfs one when the module is first loaded (static int event_handler(module_t module, int event, voi

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Bjoern A. Zeeb
On Wed, 2 Feb 2011, Monthadar Al Jaberi wrote: Hi, Thanx makes more sense, but I have noticed something weired if you can shade some light on. I added printfs one when the module is first loaded (static int event_handler(module_t module, int event, void *arg)): curthread=0xc3f95870 curthread->

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Julian Elischer
On 2/2/11 8:42 AM, Julian Elischer wrote: On 2/2/11 7:06 AM, Monthadar Al Jaberi wrote: Thanx makes more sense, but I have noticed something weired if you can shade some light on. I added printfs one when the module is first loaded (static int event_handler(module_t module, int event, void *arg

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Julian Elischer
On 2/2/11 7:06 AM, Monthadar Al Jaberi wrote: Thanx makes more sense, but I have noticed something weired if you can shade some light on. I added printfs one when the module is first loaded (static int event_handler(module_t module, int event, void *arg)): curthread=0xc3f95870 curthread->td_vnet

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-02 Thread Monthadar Al Jaberi
Thanx makes more sense, but I have noticed something weired if you can shade some light on. I added printfs one when the module is first loaded (static int event_handler(module_t module, int event, void *arg)): curthread=0xc3f95870 curthread->td_vnet=0xc3170e00 curthread->td_ucred=0xc3185d00 TD_TO

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-01 Thread Julian Elischer
ok here's how it works.. any place you access a V_xxx variable you need to have the current vnet set. so somewhere in your code path to get to that point you have to have done CURVNET_SET() and after you have finised on the way out you should do CURVNET_RESTORE(). you can get the vnet from sev

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-01 Thread Julian Elischer
On 2/1/11 11:04 AM, Monthadar Al Jaberi wrote: On Tue, Feb 1, 2011 at 6:25 PM, Julian Elischer wrote: On 2/1/11 8:40 AM, Monthadar Al Jaberi wrote: Hi, I hope I am on the write place, second try... I have written a module that loads fake wifi devices (wtap?) and distributes packets between t

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-01 Thread Monthadar Al Jaberi
On Tue, Feb 1, 2011 at 6:25 PM, Julian Elischer wrote: > On 2/1/11 8:40 AM, Monthadar Al Jaberi wrote: >> >> Hi, >> >> I hope I am on the write place, second try... >> >> I have written a module that loads fake wifi devices (wtap?) and >> distributes packets between them. For now I use route comma

Re: simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-01 Thread Julian Elischer
On 2/1/11 8:40 AM, Monthadar Al Jaberi wrote: Hi, I hope I am on the write place, second try... I have written a module that loads fake wifi devices (wtap?) and distributes packets between them. For now I use route command to route packets between them from upper layers (TCP,...). I want to tak

simulating wireless device (if_alloc panic, VirtualBox, VIMAGE)

2011-02-01 Thread Monthadar Al Jaberi
Hi, I hope I am on the write place, second try... I have written a module that loads fake wifi devices (wtap?) and distributes packets between them. For now I use route command to route packets between them from upper layers (TCP,...). I want to take it to next step and create jails with VNET. I