[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New unix backend for mirage



Hi all,

I have been working recently on refactoring the UNIX backend for Mirage.
Mainly, the modification are that now the code that handles tun/tap creation has been extracted in a new library ocaml-tuntap (You car install it with OPAM, or git://github.com/vbmithr/ocaml-tuntap).

I have refactored mirage-platform and mirage-net such that now, mirage-platform do not create tap interfaces directly in OS.Netif, but instead, there is an OS.Netif.add_vif function that takes a fd as parameter and that adds it as available interface for the unikernel.

Now, mirari generates a Backend module that contains the code to create a tap interface, and this module calls the OS.Netif.add_vif (via the manager). This Backend module is actually the equivalent of XenStore for the UNIX backend, it implements a server that listens on a UNIX domain socket for commands from mirari. For now only ADD_VIF is implemented, but PAUSE, RESUME, SUSPEND, etc.. will be implemented in the future if there is a need for it.

So basically, my big interrogation for now is "Why does this works perfectly on Linux and not on MacOS, given that the only difference is the tuntap creation code (but that is working, cleanly separated in ocaml-tuntap).

If you want to test, try the following:

Use mirage-platform, mirage-net and mirari from my repo (git://github.com/vbmithr/~), branch new-unix-backend2.

(Typically, you opam pin these packages before installing).

Then git clone git://github.com/mirage/mirage-skeleton
cd mirage-skeleton/basic, then

mirari configure --unix
mirari build --unix
sudo mirari run --unix

This should typically "work" under UNIX:


[vb@haramix ~/code/mirage-skeleton/basic]% sudo mirari run --unix [mirari] Using scanned config file hello.conf [mirari] Make the unikernel create the tap0 interface. Manager: create Manager: init done [mirari] Connecting to /tmp/mir-6224.sock... [mirari] Transmitted message ok. [backend]: Connection from mirari. [backend]: received command VIF_ADD [backend]: Creating tap0... plugging into tap0 with mac 92:f0:ab:83:1a:f6.. Netif: plug tap0 Manager: plug tap0 Manager: plug done, to listener Manager: Interface tap0 to DHCP DHCP: waiting for first offer DHCP: start discovery Sending DHCP broadcast len 552


But not work under MacOS: stuck at [backend]: Creating tap0...

Thanks to anybody that can have a look at that (preferably people with macs).

Thanks in advance,

Vincent



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.