summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2015-03-26 16:48:07 -0600
committerEric Blake <eblake@redhat.com>2015-03-26 16:57:26 -0600
commitdfc708750bb62cabd4617f3c0cf29beb27f28c28 (patch)
treeeb6be3e9b80d164e66b32ca853c506ad0f6a4e1a
parent95003cd511b74fe89f374f40d505b89ce37cbce1 (diff)
downloadlibvirt-dfc708750bb62cabd4617f3c0cf29beb27f28c28.tar.gz
relaxng: allow : in /dev/disk/by-path namesv1.2.14-rc1
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>
-rw-r--r--docs/schemas/basictypes.rng2
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args7
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml28
-rw-r--r--tests/qemuxml2argvtest.c1
4 files changed, 37 insertions, 1 deletions
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 0cd1c4e00f..f086ad2f3e 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -242,7 +242,7 @@
<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
index 0000000000..b987a3878f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args
@@ -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
index 0000000000..e4d9c97541
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml
@@ -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>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3c2fbf1674..57ef053a9d 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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,