]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
docs: schema and docs for the midonet virtualport type
authorAntoni Segura Puimedon <toni@midokura.com>
Mon, 23 Feb 2015 20:54:55 +0000 (21:54 +0100)
committerLaine Stump <laine@laine.org>
Tue, 17 Mar 2015 17:09:05 +0000 (13:09 -0400)
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>
docs/formatdomain.html.in
docs/schemas/networkcommon.rng
src/conf/netdev_vport_profile_conf.c
src/util/virnetdevvportprofile.c
tests/qemuxml2argvdata/qemuxml2argv-net-midonet.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

index 8d989155419cda5182366c1b73b1899961d73400..ab519829575b594fb895832b562ce6805fd23f53 100644 (file)
     &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>
index 162ea3d4d90d492fbcf98e144c9995e91e2c8827..cc8b1dcad7a6922f3ae25ff9e40580f8f26f87a3 100644 (file)
           </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">
index 8da0838f0d709012f2dd16adad2f9e7b6f3c8288..1641a3e01ee276716744d6a425a1f75041ba83da 100644 (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];
 
index 09acb52e5c44af4e1e5af20b71930c61c9bfe314..d0d455208ca9979bb2329db0f4c73c9a914b3dc7 100644 (file)
@@ -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 (file)
index 0000000..ae5a174
--- /dev/null
@@ -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>
index 7755ea3675c684b1c4a6d9bb41f0a64ca7e02b4f..346a0251a67de08c308a932fc0cea8e5dedd221c 100644 (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");