[libvirt] [PATCHv2] xen: test for driver=tap2 sub-type in xen-xm

Philipp Hahn hahn at univention.de
Thu May 19 06:24:56 UTC 2016


tap2 only handles 'aio', but not 'raw', which must be explicitly given:

XML:raw needs to be translated to XM:aio for 'tap' and 'tap2' Xen
drivers.
---
 tests/xmconfigdata/test-disk-drv-blktap-raw.cfg  | 12 +++++++++
 tests/xmconfigdata/test-disk-drv-blktap-raw.xml  | 33 ++++++++++++++++++++++++
 tests/xmconfigdata/test-disk-drv-blktap2-raw.cfg | 12 +++++++++
 tests/xmconfigdata/test-disk-drv-blktap2-raw.xml | 33 ++++++++++++++++++++++++
 tests/xmconfigtest.c                             |  3 +++
 5 files changed, 93 insertions(+)
 create mode 100644 tests/xmconfigdata/test-disk-drv-blktap-raw.cfg
 create mode 100644 tests/xmconfigdata/test-disk-drv-blktap-raw.xml
 create mode 100644 tests/xmconfigdata/test-disk-drv-blktap2-raw.cfg
 create mode 100644 tests/xmconfigdata/test-disk-drv-blktap2-raw.xml

diff --git a/tests/xmconfigdata/test-disk-drv-blktap-raw.cfg b/tests/xmconfigdata/test-disk-drv-blktap-raw.cfg
new file mode 100644
index 0000000..aa38bc1
--- /dev/null
+++ b/tests/xmconfigdata/test-disk-drv-blktap-raw.cfg
@@ -0,0 +1,12 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+disk = [ "tap:aio:/root/some.img,xvda,w" ]
diff --git a/tests/xmconfigdata/test-disk-drv-blktap-raw.xml b/tests/xmconfigdata/test-disk-drv-blktap-raw.xml
new file mode 100644
index 0000000..cf859ba
--- /dev/null
+++ b/tests/xmconfigdata/test-disk-drv-blktap-raw.xml
@@ -0,0 +1,33 @@
+<domain type='xen'>
+  <name>XenGuest1</name>
+  <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>592896</memory>
+  <currentMemory unit='KiB'>403456</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='i686' machine='xenpv'>linux</type>
+  </os>
+  <clock offset='utc' adjustment='reset'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='tap' type='raw'/>
+      <source file='/root/some.img'/>
+      <target dev='xvda' bus='xen'/>
+    </disk>
+    <interface type='bridge'>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
+      <script path='vif-bridge'/>
+    </interface>
+    <console type='pty'>
+      <target type='xen' port='0'/>
+    </console>
+    <input type='mouse' bus='xen'/>
+    <input type='keyboard' bus='xen'/>
+    <memballoon model='xen'/>
+  </devices>
+</domain>
diff --git a/tests/xmconfigdata/test-disk-drv-blktap2-raw.cfg b/tests/xmconfigdata/test-disk-drv-blktap2-raw.cfg
new file mode 100644
index 0000000..c74e543
--- /dev/null
+++ b/tests/xmconfigdata/test-disk-drv-blktap2-raw.cfg
@@ -0,0 +1,12 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+disk = [ "tap2:aio:/root/some.img,xvda,w" ]
diff --git a/tests/xmconfigdata/test-disk-drv-blktap2-raw.xml b/tests/xmconfigdata/test-disk-drv-blktap2-raw.xml
new file mode 100644
index 0000000..af2519a
--- /dev/null
+++ b/tests/xmconfigdata/test-disk-drv-blktap2-raw.xml
@@ -0,0 +1,33 @@
+<domain type='xen'>
+  <name>XenGuest1</name>
+  <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>592896</memory>
+  <currentMemory unit='KiB'>403456</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='i686' machine='xenpv'>linux</type>
+  </os>
+  <clock offset='utc' adjustment='reset'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='tap2' type='raw'/>
+      <source file='/root/some.img'/>
+      <target dev='xvda' bus='xen'/>
+    </disk>
+    <interface type='bridge'>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
+      <script path='vif-bridge'/>
+    </interface>
+    <console type='pty'>
+      <target type='xen' port='0'/>
+    </console>
+    <input type='mouse' bus='xen'/>
+    <input type='keyboard' bus='xen'/>
+    <memballoon model='xen'/>
+  </devices>
+</domain>
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 9b21a13..8964a2a 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -249,6 +249,9 @@ mymain(void)
     DO_TEST("no-source-cdrom");
     DO_TEST("pci-devs");
 
+    DO_TEST("disk-drv-blktap-raw");
+    DO_TEST("disk-drv-blktap2-raw");
+
     virObjectUnref(caps);
     virObjectUnref(xmlopt);
 
-- 
2.1.4




More information about the libvir-list mailing list