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

Re: mirari updates

I had a quick chat with Haris about this.  I think what we're missing in the 
UNIX backend is a simple control socket that mirrors the operations that 
Xenstore provides a VM: start, stop, suspend, hotplug device, and so on.  
Without this, we're forced to hardcode many control operations in the library 

If we make the runloop of a UNIX Mirage process mimic the Xen version, then 
many of these hacks go away.  For instance, the bridging configuration can be 
done from a command line utility that sets up tun (or pcap) devices, and then 
passes the fd to the listening Mirage UNIX process.

It's very Erlang and actor-like, but quite easy to build into Mirari with a bit 
of cmdliner magic.  Dave already has an Lwt fd-passing library I believe.


On 28 Feb 2013, at 11:47, Haris Rotsos <cr409@xxxxxxxxxxxx> wrote:

> This is something I did a while back in order to allow interfaces to open in 
> Mac environments. It was the only way to open raw ethernet sockets in MacOSX. 
> The equivalent action in Linux should open a raw ethernet socket using Libc 
> (Something along this lines 
> http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html). At the moment 
> I haven't fixed the Linux code to work. In the case of Linux I had an ifdef 
> function which implements an empty function for this. 
> It is a bit complicated to handle this case because there is a different 
> approach on how to read packets from pcap fd in Macosx and from raw ethernet 
> sockets in Linux. The difference is that in pcap you need to skip the pcap 
> header. This is not the case in Linux. I can fix quickly the code if you 
> could give me some hint on how I could detect in Ocaml the OS type. 
> On 28 February 2013 11:07, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
> On 27 Feb 2013, at 22:15, Vincent B. <vb@xxxxxxxxx> wrote:
> >
> > No, I have a problem with the UNIX backend, the function pcap_opendev is 
> > not implemented in Linux. I have tried to implement that this afternoon, 
> > only to find out in the end that this was not straightforward 
> > (pcap_open_live returns a pcap_t * and not a fd). I did not have the time 
> > to inquire further. I spent hours trying to make the buildsystem (which is 
> > based on a cmd script + ocamlbuild/custom myocamlbuild -- maybe we should 
> > port that on obuild ?) link the resulting libs with pcap (-lpcap). I did 
> > not manage to do that either, wasn’t proficient enough in ocamlbuild 
> > scripting.
> Truth be told, I have no idea what pcap is doing in there.  Haris, is it to 
> avoid requiring a tuntap bridge and to work with an existing interface?
> I'd be inclined to not expose it all to Linux for the moment, since it 
> already has the bridging support for tuntap. MacOS X doesn't have 
> kernel-level bridging, so I can see why pcap is useful there.
> Btw, the cmd script was just a quick shim.  Replacing it with obuild would be 
> great, if it can handle all the C bindings.  It may be better to build the C 
> components with a conventional Makefile, and the OCaml libraries with obuild.
> -anil
> -- 
> Charalampos Rotsos
> PhD student
> The University of Cambridge
> Computer Laboratory
> William Gates Building
> JJ Thomson Avenue
> Cambridge
> CB3 0FD
> Phone: +44-(0) 1223 767032
> Email: cr409@xxxxxxxxxxxx



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