]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: Add missed RNG schema for interface
authorOsier Yang <jyang@redhat.com>
Mon, 16 Jan 2012 14:08:07 +0000 (22:08 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 17 Jan 2012 09:09:47 +0000 (17:09 +0800)
We support <interface> of type "mcast", "server", and "client",
but the RNG schema for them are missed. Attribute "address" is
optional for "server" type. And these 3 types support
<mac address='MAC'/>, too.

docs/formatdomain.html.in
docs/schemas/domaincommon.rng
tests/qemuxml2argvdata/qemuxml2argv-net-client.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-client.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-server.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-server.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

index faf42df9bab9f8bc1d205fb301fdeb95e4389dff..6b067230956ea28864f34b1d687e0051810f80c4 100644 (file)
 <pre>
   ...
   &lt;devices&gt;
+    &lt;mac address='52:54:00:6d:90:01'&gt;
     &lt;interface type='mcast'&gt;
       &lt;source address='230.0.0.1' port='5558'/&gt;
     &lt;/interface&gt;
   ...
   &lt;devices&gt;
     &lt;interface type='server'&gt;
+    &lt;mac address='52:54:00:22:c9:42'&gt;
       &lt;source address='192.168.0.1' port='5558'/&gt;
     &lt;/interface&gt;
     ...
     &lt;interface type='client'&gt;
+    &lt;mac address='52:54:00:8b:c9:51'&gt;
     &lt;source address='192.168.0.1' port='5558'/&gt;
     &lt;/interface&gt;
   &lt;/devices&gt;
index 243ff934e7b9e5a4084ea34280e502a4820d1111..b54fd68ac7eb80fc01819f5e831ceba7c57780d0 100644 (file)
             <ref name="interface-options"/>
           </interleave>
         </group>
+        <group>
+          <attribute name="type">
+            <choice>
+              <value>mcast</value>
+              <value>client</value>
+            </choice>
+          </attribute>
+          <interleave>
+            <element name="source">
+              <attribute name="address">
+                <ref name="ipv4Addr"/>
+              </attribute>
+              <attribute name="port">
+                <ref name="PortNumber"/>
+              </attribute>
+              <empty/>
+            </element>
+            <optional>
+              <element name="mac">
+                <attribute name="address">
+                  <ref name="macAddr"/>
+                </attribute>
+                <empty/>
+              </element>
+            </optional>
+          </interleave>
+        </group>
+        <group>
+          <attribute name="type">
+            <value>server</value>
+          </attribute>
+          <interleave>
+            <element name="source">
+              <optional>
+                <attribute name="address">
+                  <ref name="ipv4Addr"/>
+                </attribute>
+              </optional>
+              <attribute name="port">
+                <ref name="PortNumber"/>
+              </attribute>
+              <empty/>
+            </element>
+            <optional>
+              <element name="mac">
+                <attribute name="address">
+                  <ref name="macAddr"/>
+                </attribute>
+                <empty/>
+              </element>
+            </optional>
+          </interleave>
+        </group>
       </choice>
     </element>
   </define>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-client.args b/tests/qemuxml2argvdata/qemuxml2argv-net-client.args
new file mode 100644 (file)
index 0000000..f8853ac
--- /dev/null
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,\
+macaddr=52:54:00:8c:b9:05,vlan=0 -net socket,connect=192.168.0.1:5558,vlan=0 \
+-serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-client.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-client.xml
new file mode 100644 (file)
index 0000000..b4cca6e
--- /dev/null
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219136</memory>
+  <currentMemory>219136</currentMemory>
+  <vcpu>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' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <interface type='client'>
+      <mac address='52:54:00:8c:b9:05'/>
+      <source address='192.168.0.1' port='5558'/>
+    </interface>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args
new file mode 100644 (file)
index 0000000..bb4a042
--- /dev/null
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,\
+macaddr=52:54:00:8c:b9:05,vlan=0 -net socket,mcast=192.0.0.1:5558,vlan=0 \
+-serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml
new file mode 100644 (file)
index 0000000..a3929a5
--- /dev/null
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219136</memory>
+  <currentMemory>219136</currentMemory>
+  <vcpu>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' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <interface type='mcast'>
+      <mac address='52:54:00:8c:b9:05'/>
+      <source address='192.0.0.1' port='5558'/>
+    </interface>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-server.args b/tests/qemuxml2argvdata/qemuxml2argv-net-server.args
new file mode 100644 (file)
index 0000000..1451e32
--- /dev/null
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,\
+macaddr=52:54:00:8c:b9:05,vlan=0 -net socket,listen=192.168.0.1:5558,vlan=0 \
+-serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-server.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-server.xml
new file mode 100644 (file)
index 0000000..eca440d
--- /dev/null
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219136</memory>
+  <currentMemory>219136</currentMemory>
+  <vcpu>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' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <interface type='server'>
+      <mac address='52:54:00:8c:b9:05'/>
+      <source address='192.168.0.1' port='5558'/>
+    </interface>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
index 7beaa4b8cf080013098305e59565ef8e0199fecf..fd3c9bbd533ee1d99f0eb4baf9548c00ae5b6904 100644 (file)
@@ -519,6 +519,9 @@ mymain(void)
     DO_TEST("net-eth", false, NONE);
     DO_TEST("net-eth-ifname", false, NONE);
     DO_TEST("net-eth-names", false, QEMU_CAPS_NET_NAME);
+    DO_TEST("net-client", false, NONE);
+    DO_TEST("net-server", false, NONE);
+    DO_TEST("net-mcast", false, NONE);
 
     DO_TEST("serial-vc", false, NONE);
     DO_TEST("serial-pty", false, NONE);