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

[Xen-devel] Rumprun based upstream QEMU stubdom status update



Hi all

I've been working on and off on upstream QEMU stubdom. Unfortunately in
the last few months I didn't make much progress as I had expected. Some
folks expressed interests during Xen developer summit on this project
and I think it would be better I post what I have as soon as possible.

In short, it is now possible to compile and run QEMU as a PV guest,
but I haven't finished the plumbing of toolstack code, hence I don't
know whether it functions as a device model.

Note that there are quite a bit of hacks inside those scripts to work
around problems in build systems of different piece of software.

There is a small program to configure network topology inside the
guest. It creates a bridge, then adds a bunch of tap interfaces and
existing Xen vif interface(s) to the bridge.

What are missing:

1. Inter-domain communication mechanism: this can be subsidised by
   network interface for now.
2. Plumbing through libxl. It will be using rumprun to launch QEMU
   stubdom.
3. Integration with Raisin build system. This is the ulterior goal to
   get rid of all customised build scripts.

I haven't checked everything, but some of the rump kernel interfaces
are not yet declared stable. Relevant discussions should mainly take
place on rump kernel mailing list and CC xen-devel when necessary.

Here are the step-by-step guide for building a QEMU unikernel.

Note that all of my scripts have hardcoded paths (/local/scratch/...),
so anyone who is interested in using them would need to replace the
hardcoded paths with something sensible.

$XEN refers to Xen source code. I will always refer to upstream
repositories and only provide git branches unless there are local
changes needed.

Rumprun is a fast moving target so I will also state the working
version of things.

# Build rumprun toolchain (based on a5f58548)

$ git clone https://github.com/rumpkernel/rumprun.git rumprun.git
$ cd rumprun.git
$ export XEN_HEADERS=$XEN/xen/include/public
$ ./build-rr xen -- -j8

If nothing goes wrong, the toolchain will be available under app-tools
directory.

# Build QEMU dependency

Currently only a minimum set of libraries that QEMU depends on are
built. They are zlib, libffi, glib, libpixman, Xen libxenctrl and
libxenstore. More libraries might be needed as we move forward, but
overall the build process should be the same.

I have a git repository for build scripts.

$ git clone https://xenbits.xen.org/people/liuw/rump-build-scrpt-junk.git 
rump-build-script-junk
$ cd rump-build-script-junk
$ ./script 2>&1 | tee buildlog

The script will download tarballs from various websites and expects
Xen source tree resides at a fix path (see script).

If everything goes well, those libraries will be inside
/local/scratch/Rump-kernels/prefix. If something goes wrong, dig into
buildlog and figure out why. :-)

# Build QEMU

I have prepared a branch for my WIP patches for QEMU.

$ cd rump-build-junk-script
$ git clone https://xenbits.xen.org/people/liuw/qemu.git -b wip.rump qemu
$ ./script-qemu 2>&1 | tee buildlog

If everything goes well, qemu will be inside
/local/scratch/Rump-kernels/prefix-qemu/bin.

But that's not yet a working domain image.

# "Baking" QEMU into a unikernel

$ git clone https://xenbits.xen.org/people/liuw/qemu-rump-config.git 
qemu-rump-config
$ cd rump-build-junk-script
$ ./script-bake

Then the final binary will be in
/local/scratch/Rump-kernels/prefix-qemu/bin/qemu-system-i386-rump.

# Test the unikernel

Note that I omit path prefixes in following commands.

$ scp qemu-system-i386-rump testbox:~
$ scp app-tools/rumprun testbox:~

Then on testbox.

$ ./rumprun -S xen -i qemu-system-i386-rump --help

This rune should start the guest, attach to its console and show you
the help information from QEMU.

To add network interface, see ./rumprun -h.


Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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