[Pkg-xen-devel] Bug#554805: patch to enable routed networking in HVM+ioemu

Cyrille Chépélov cyrille.chepelov at keyconsulting.fr
Fri Nov 6 17:19:22 UTC 2009


tag 554805 + patch
thanks

The problem to solve is that qemu-ifup assumes the world is always
bridged, and vif-routed does not know of the concept of TAP devices, and
even if it did, it has at this point no way to get at qemu's TAP device
anyway.

The following set of patches help run in the ioemu-HVM situation: 
  * xend-image.py.diff : modifies the HVM loader so that when running in
ioemu-HVM mode, Xend invokes qemu-dm with a phony bridge name, intended
for qemu-ifup
  * qemu-ifup (just the whole script): this version checks for the
special bridge name. If it is present, the prefix is truncated and the
contents are assumed to be the VIF device name. Since I don't see a much
better way for now to provide vif-routing with the TAP device name, a
small "mailbox" file is created.
            WARNING: as is, this creates OR uses a directory
within /tmp. This might cause a local privilege escalation. Don't let
random users roam on your dom0 -- if this proof of concept is used for
production purpose, a real place somewhere safe within /var/run should
be used instead.
  * vif-route.patch: this script now looks for two conditions:
        1) the type of the vif is ioemu
        2) the mailbox file (left by qemu-ifup) is present (in which
case it's assumed to contain a VIF interface name)
    if both conditions are present, then from that point on vif-route
ignores the vifN.0 interface and sets up tapM instead.

Net result: on this system, ioemu-HVM guests now have working networking
(another guest, which uses netfront-HVM [a SLES 11 VM], also works, but
taking advantage of the faster VIF scheme)

Thanks in advance,

    -- Cyrille
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xend-image.py.diff
Type: text/x-patch
Size: 1022 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-xen-devel/attachments/20091106/360d83d6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qemu-ifup
Type: application/x-shellscript
Size: 426 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-xen-devel/attachments/20091106/360d83d6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vif-route.patch
Type: text/x-patch
Size: 1672 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-xen-devel/attachments/20091106/360d83d6/attachment-0002.bin>


More information about the Pkg-xen-devel mailing list