]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
relaxng: allow : in /dev/disk/by-path names
authorEric Blake <eblake@redhat.com>
Thu, 26 Mar 2015 22:48:07 +0000 (16:48 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 26 Mar 2015 22:57:26 +0000 (16:57 -0600)
On IRC, Hydrar pointed a problem where 'virsh edit' failed on
his domain created through an ISCSI pool managed by virt-manager,
all because the XML included a block device with colons in the
name.

* docs/schemas/basictypes.rng (absFilePath): Add colon as safe.
* tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml: New file.
* tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args: Likewise.
* tests/qemuxml2argvtest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
docs/schemas/basictypes.rng
tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

index 0cd1c4e00f1b3156b4d3b244632eec2a37cc7a05..f086ad2f3edb524ead02e4a6aaffd9d2935b95ac 100644 (file)
 
   <define name="absFilePath">
     <data type="string">
-      <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%,]+</param>
+      <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&amp;&quot;&apos;&lt;&gt;/%,:]+</param>
     </data>
   </define>
 
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args
new file mode 100644 (file)
index 0000000..b987a38
--- /dev/null
@@ -0,0 +1,7 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -usb \
+-hda /dev/disk/by-path/ip-192.168.44.1:3260-iscsi-iqn.2011-02.lan.hdserver\
+:hydrar-desktop.win7vm-lun-0 -net none \
+-serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml
new file mode 100644 (file)
index 0000000..e4d9c97
--- /dev/null
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</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'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/disk/by-path/ip-192.168.44.1:3260-iscsi-iqn.2011-02.lan.hdserver:hydrar-desktop.win7vm-lun-0'/>
+      <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'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 3c2fbf167408c2099f7a711f57dc377d28b30534..57ef053a9df691439d067a32d5e441a4ef541aa8 100644 (file)
@@ -708,6 +708,7 @@ mymain(void)
     DO_TEST("hugepages-pages6", NONE);
     DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE);
     DO_TEST("disk-cdrom", NONE);
+    DO_TEST("disk-iscsi", NONE);
     DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE,
             QEMU_CAPS_DRIVE);
     DO_TEST("disk-cdrom-network-https", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE,