On Thu, Oct 16, 2008 at 12:42:17PM +0100, Daniel P. Berrange wrote:
[...]
Like QEMU, UML has an admin monitor console. It is a little
different
though, using a UNIX domain socket, in datagram mode, sending command
strings back & forth. This actaully makes it a little easier to deal
with in libvirt. User mode linux has a uml_mconsole command line tool
to interact with it, but I directly implement the socket support in
libvirt instead, so this driver does not (yet) have any dependancy on
the UML utilities.
The driver is largely a clone of the QEMU driver, replacing the bit which
builds the command line argv, and all code dealing with the QEMU monitor.
Since the monitor socket is datagram based, we can't make use of it for
detecting VM shutdown as we do with QEMU/LXC. So instead, I make use of
inotify, to monitor $HOME/.uml which is populated witha directory for
each VM. When we see a directory created, libvirt marks the corresponding
VM as running, finds it PID & probes the monitor for the PTY config. When
we see a directory deleted, libvirt makes the VM as shutoff and frees any
resources its holding. This actually works very nicely & simply.
Seems then that this driver could be made restarteable easilly in case
of libvirtd shutdown/restart, right ? Since everything is available from
the filesystem and there is no tight coupling between libvirtd and
the uml process, it even seems a starting libvirtd would be able to
discover and manage uml instances which were not started with libvirt,
right ?
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/