[libvirt] [PATCH 0/5] macvtap support for Qemu/KVM VMs via libvirt

Stefan Berger stefanb at us.ibm.com
Thu Feb 11 14:48:07 UTC 2010


Hello!

  This is a re-post of previously posted patches following Daniel
Berrange's request for changes along with other fixes PLUS a rebase
to the latest code where the conn parameter is missing along with
changes requested by Daniel Veillard.

  The following patches provide support for making the macvtap
networking device type available to Qemu/KVM VMs. The patches rely on
the macvtap driver that just became available through the Linux net-next
tree (fixes still may be necessary) and make the device available to
Qemu/KVM via a tap file descriptor similar to a 'regular' tap device.
  Following up on previous discussions, the libvirt patches allow using
the following XML in the domain description to enable qemu network
connectivity via this type of device:

    <interface type='direct'>
      <source dev='eth1' mode='vepa'/>
      <model type='virtio'/>
    </interface>

  The above XML indicates that eth1 is the Ethernet interface to link
the macvtap device to and communicate to the network. As a consequence,
libvirt will create an instance of a macvtap device, assign it the same
MAC address as the VM's interface has and open a file descriptor of the
associated character device /dev/tap%d and pass it via command line to
Qemu/kvm. In the above XML the mode can be chosen as 'vepa', 'private'
or 'bridge' and is by default set to 'vepa'(by the driver) if omitted.

Attachment and detachment of macvtap to/from a running VM also works.

Regards,
   Stefan







More information about the libvir-list mailing list