From a9fbe3b15740856863561b809e8196b2d87adce2 Mon Sep 17 00:00:00 2001 From: Antoni Segura Puimedon Date: Mon, 23 Feb 2015 21:54:55 +0100 Subject: [PATCH] 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 --- docs/formatdomain.html.in | 34 ++++++++++++++++++ docs/schemas/networkcommon.rng | 12 +++++++ src/conf/netdev_vport_profile_conf.c | 3 +- src/util/virnetdevvportprofile.c | 5 +++ .../qemuxml2argv-net-midonet.xml | 35 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 6 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-midonet.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8d98915541..ab51982957 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3665,6 +3665,40 @@ </interface> ... </devices> + ... + +

+ 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 + <virtualport type='midonet'/> to the + interface definition. (Since + 1.2.13). The Midonet virtualport type requires an + interfaceid attribute in its + <parameters> element. This interface id is the UUID + that specifies which port in the virtual network topology will be bound + to the interface. +

+
+  ...
+  <devices>
+    ...
+    <interface type='bridge'>
+      <source bridge='br0'/>
+    </interface>
+    <interface type='bridge'>
+      <source bridge='br1'/>
+      <target dev='vnet7'/>
+      <mac address="00:11:22:33:44:55"/>
+    </interface>
+    <interface type='bridge'>
+      <source bridge='midonet'/>
+      <virtualport type='midonet'>
+        <parameters interfaceid='0b2d64da-3d0e-431e-afdd-804415d6ebbb'/>
+      </virtualport>
+    </interface>
+    ...
+  </devices>
   ...
Userspace SLIRP stack
diff --git a/docs/schemas/networkcommon.rng b/docs/schemas/networkcommon.rng index 162ea3d4d9..cc8b1dcad7 100644 --- a/docs/schemas/networkcommon.rng +++ b/docs/schemas/networkcommon.rng @@ -78,6 +78,18 @@ + + + + midonet + + + + + + + + diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c index 8da0838f0d..1641a3e01e 100644 --- a/src/conf/netdev_vport_profile_conf.c +++ b/src/conf/netdev_vport_profile_conf.c @@ -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]; diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c index 09acb52e5c..d0d455208c 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -189,6 +189,11 @@ virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport, } } break; + + case VIR_NETDEV_VPORT_PROFILE_MIDONET: + if (!virtport->interfaceID_specified) + missing = "interfaceid"; + break; } if (missing) { diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-midonet.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-midonet.xml new file mode 100644 index 0000000000..ae5a1741d7 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-midonet.xml @@ -0,0 +1,35 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + +
+ + + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 7755ea3675..346a0251a6 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -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");