docs: schema and docs for the midonet virtualport type

Midonet is an opensource virtual networking that over lays the IP
network between hypervisors. Currently, such networks can be made
with the openvswitch virtualport type.

This patch, defines the schema and documentation that will serve
as basis for the follow up patches that will add support to libvirt
for using Midonet virtual ports for its interfaces. The schema
definition requires that the port profile expresses its interfaceid
as part of the port profile. For that reason, this is part of the
patch too.

Signed-off-by: Antoni Segura Puimedon <toni+libvirt@midokura.com>
This commit is contained in:
Antoni Segura Puimedon 2015-02-23 21:54:55 +01:00 committed by Laine Stump
parent e1f6485694
commit a9fbe3b157
6 changed files with 89 additions and 1 deletions

View File

@ -3665,6 +3665,40 @@
&lt;/interface&gt;
...
&lt;/devices&gt;
...</pre>
<p>
On hosts that support Open vSwitch on the kernel side and have the
Midonet Host Agent configured, it is also possible to connect to the
'midonet' bridge device by adding a
<code>&lt;virtualport type='midonet'/&gt;</code> to the
interface definition. (<span class="since">Since
1.2.13</span>). The Midonet virtualport type requires an
<code>interfaceid</code> attribute in its
<code>&lt;parameters&gt;</code> element. This interface id is the UUID
that specifies which port in the virtual network topology will be bound
to the interface.
</p>
<pre>
...
&lt;devices&gt;
...
&lt;interface type='bridge'&gt;
&lt;source bridge='br0'/&gt;
&lt;/interface&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='br1'/&gt;
&lt;target dev='vnet7'/&gt;
&lt;mac address="00:11:22:33:44:55"/&gt;
&lt;/interface&gt;
&lt;interface type='bridge'&gt;
&lt;source bridge='midonet'/&gt;
&lt;virtualport type='midonet'&gt;
&lt;parameters interfaceid='0b2d64da-3d0e-431e-afdd-804415d6ebbb'/&gt;
&lt;/virtualport&gt;
&lt;/interface&gt;
...
&lt;/devices&gt;
...</pre>
<h5><a name="elementsNICSSlirp">Userspace SLIRP stack</a></h5>

View File

@ -78,6 +78,18 @@
</optional>
</element>
</group>
<group>
<element name="virtualport">
<attribute name="type">
<value>midonet</value>
</attribute>
<element name="parameters">
<attribute name="interfaceid">
<ref name="UUID"/>
</attribute>
</element>
</element>
</group>
<group>
<!-- use this when no type attribute is present -->
<element name="virtualport">

View File

@ -260,7 +260,8 @@ virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort,
virBufferAsprintf(buf, " instanceid='%s'", uuidstr);
}
if (virtPort->interfaceID_specified &&
(type == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH ||
(type == VIR_NETDEV_VPORT_PROFILE_MIDONET ||
type == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH ||
type == VIR_NETDEV_VPORT_PROFILE_NONE)) {
char uuidstr[VIR_UUID_STRING_BUFLEN];

View File

@ -189,6 +189,11 @@ virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport,
}
}
break;
case VIR_NETDEV_VPORT_PROFILE_MIDONET:
if (!virtport->interfaceID_specified)
missing = "interfaceid";
break;
}
if (missing) {

View File

@ -0,0 +1,35 @@
<domain type='qemu'>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
<disk type='block' device='disk'>
<source dev='/dev/HostVG/QEMUGuest1'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
<interface type='bridge'>
<mac address='00:11:22:33:44:55'/>
<source bridge='midonet'/>
<virtualport type='midonet'>
<parameters interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
</virtualport>
<model type='virtio'/>
</interface>
<memballoon model='virtio'/>
</devices>
</domain>

View File

@ -273,6 +273,7 @@ mymain(void)
DO_TEST("net-virtio-network-portgroup");
DO_TEST("net-hostdev");
DO_TEST("net-hostdev-vfio");
DO_TEST("net-midonet");
DO_TEST("net-openvswitch");
DO_TEST("sound");
DO_TEST("sound-device");