mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
schema: add support for Windows file paths and device names
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Matt Coleman <matt@datto.com>
This commit is contained in:
parent
a7a1d1f59e
commit
ce8fb26a66
@ -299,7 +299,7 @@
|
||||
|
||||
<define name="absFilePath">
|
||||
<data type="string">
|
||||
<param name="pattern">/.+</param>
|
||||
<param name="pattern">(/|[a-zA-Z]:\\).+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
|
@ -1691,7 +1691,10 @@
|
||||
<interleave>
|
||||
<optional>
|
||||
<attribute name="dev">
|
||||
<ref name="absFilePath"/>
|
||||
<choice>
|
||||
<ref name="absFilePath"/>
|
||||
<ref name="deviceName"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<ref name="diskSourceCommon"/>
|
||||
|
17
tests/genericxml2xmlindata/disk-hyperv-physical.xml
Normal file
17
tests/genericxml2xmlindata/disk-hyperv-physical.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<domain type='hyperv'>
|
||||
<name>test_disk-hyperv</name>
|
||||
<uuid>deadbeef-dead-beef-dead-beefdeadbeef</uuid>
|
||||
<memory unit='KiB'>1048576</memory>
|
||||
<vcpu placement='static'>3</vcpu>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='2'/>
|
||||
<target dev='sdb' bus='scsi'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='scsi' index='0'/>
|
||||
</devices>
|
||||
</domain>
|
17
tests/genericxml2xmlindata/disk-hyperv-virtual.xml
Normal file
17
tests/genericxml2xmlindata/disk-hyperv-virtual.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<domain type='hyperv'>
|
||||
<name>test_disk-hyperv</name>
|
||||
<uuid>deadbeef-dead-beef-dead-beefdeadbeef</uuid>
|
||||
<memory unit='KiB'>1048576</memory>
|
||||
<vcpu placement='static'>3</vcpu>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='X:\test_disk-hyperv.vhdx'/>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='scsi' index='0'/>
|
||||
</devices>
|
||||
</domain>
|
23
tests/genericxml2xmloutdata/disk-hyperv-physical.xml
Normal file
23
tests/genericxml2xmloutdata/disk-hyperv-physical.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<domain type='hyperv'>
|
||||
<name>test_disk-hyperv</name>
|
||||
<uuid>deadbeef-dead-beef-dead-beefdeadbeef</uuid>
|
||||
<memory unit='KiB'>1048576</memory>
|
||||
<currentMemory unit='KiB'>1048576</currentMemory>
|
||||
<vcpu placement='static'>3</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>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>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='2'/>
|
||||
<target dev='sdb' bus='scsi'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='scsi' index='0'/>
|
||||
</devices>
|
||||
</domain>
|
23
tests/genericxml2xmloutdata/disk-hyperv-virtual.xml
Normal file
23
tests/genericxml2xmloutdata/disk-hyperv-virtual.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<domain type='hyperv'>
|
||||
<name>test_disk-hyperv</name>
|
||||
<uuid>deadbeef-dead-beef-dead-beefdeadbeef</uuid>
|
||||
<memory unit='KiB'>1048576</memory>
|
||||
<currentMemory unit='KiB'>1048576</currentMemory>
|
||||
<vcpu placement='static'>3</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>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>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='X:\test_disk-hyperv.vhdx'/>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='scsi' index='0'/>
|
||||
</devices>
|
||||
</domain>
|
@ -154,6 +154,8 @@ mymain(void)
|
||||
DO_TEST_FULL(name, 1, false, TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS)
|
||||
|
||||
DO_TEST_DIFFERENT("disk-virtio");
|
||||
DO_TEST_DIFFERENT("disk-hyperv-physical");
|
||||
DO_TEST_DIFFERENT("disk-hyperv-virtual");
|
||||
|
||||
DO_TEST_DIFFERENT("graphics-vnc-minimal");
|
||||
DO_TEST_DIFFERENT("graphics-vnc-manual-port");
|
||||
|
Loading…
Reference in New Issue
Block a user