From: Kirill Shchetiniuk <kshcheti(a)redhat.com>
Previously, path types were defined separately for files and
directories. The `absDirPath` type, in particular, did not accept
Windows-style paths. Now, absolute paths for files and directories are
united under the 'absolutePath' type.
Relative paths were in fact the same but under different names, and in
some places the 'filePath` was used for the directories. Now, the
relative path type definition is united under the 'relativePath' type.
Now only one place is explicitly meant to accept relative paths.
<define name="sourceinfonetrelativepath">
<element name="dir">
<attribute name="path">
<ref name="relativePath"/>
</attribute>
<empty/>
</element>
</define>
In other places, it is possible to use absolute paths, but the
`relativePath` type was retained for users who previously relied on
relative paths, to avoid breaking their existing setups. Thus,
relative paths can still be accepted.
Signed-off-by: Kirill Shchetiniuk <kshcheti(a)redhat.com>
---
src/conf/schemas/basictypes.rng | 18 +---
src/conf/schemas/capability.rng | 4 +-
src/conf/schemas/domainbackup.rng | 10 +--
src/conf/schemas/domaincaps.rng | 2 +-
src/conf/schemas/domaincheckpoint.rng | 2 +-
src/conf/schemas/domaincommon.rng | 124 +++++++++++++-------------
src/conf/schemas/domainsnapshot.rng | 8 +-
src/conf/schemas/network.rng | 2 +-
src/conf/schemas/secret.rng | 2 +-
src/conf/schemas/storagecommon.rng | 2 +-
src/conf/schemas/storagepool.rng | 10 +--
src/conf/schemas/storagevol.rng | 6 +-
12 files changed, 89 insertions(+), 101 deletions(-)
diff --git a/src/conf/schemas/basictypes.rng b/src/conf/schemas/basictypes.rng
index 2931e316b7..f0f4086ace 100644
--- a/src/conf/schemas/basictypes.rng
+++ b/src/conf/schemas/basictypes.rng
@@ -305,36 +305,24 @@
</data>
</define>
- <define name="filePath">
+ <define name="absolutePath">
<data type="string">
- <param name="pattern">.+</param>
+ <param name="pattern">(/|[a-zA-Z]:\\).*</param>
</data>
</define>
- <define name="dirPath">
+ <define name="relativePath">
<data type="string">
<param name="pattern">.+</param>
</data>
</define>
- <define name="absFilePath">
- <data type="string">
- <param name="pattern">(/|[a-zA-Z]:\\).+</param>
- </data>
- </define>
-
<define name="vmwarePath">
<data type="string">
<param name="pattern">\[[^\]]+\] .+</param>
</data>
</define>
- <define name="absDirPath">
- <data type="string">
- <param name="pattern">/.*</param>
- </data>
- </define>
-
<define name="unit">
<data type="string">
<param
name="pattern">([bB]([yY][tT][eE][sS]?)?)|([kKmMgGtTpPeE]([iI]?[bB])?)</param>
diff --git a/src/conf/schemas/capability.rng b/src/conf/schemas/capability.rng
index a1606941e7..4fc8fd82b7 100644
--- a/src/conf/schemas/capability.rng
+++ b/src/conf/schemas/capability.rng
@@ -378,13 +378,13 @@
<define name="emulator">
<element name="emulator">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</define>
<define name="loader">
<element name="loader">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</define>
diff --git a/src/conf/schemas/domainbackup.rng b/src/conf/schemas/domainbackup.rng
index 91cf2a7bbd..9d6571f90f 100644
--- a/src/conf/schemas/domainbackup.rng
+++ b/src/conf/schemas/domainbackup.rng
@@ -87,7 +87,7 @@
<value>unix</value>
</attribute>
<attribute name="socket">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
<group>
@@ -185,7 +185,7 @@
<optional>
<element name="target">
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<interleave>
<zeroOrMore>
@@ -209,7 +209,7 @@
<optional>
<element name="target">
<attribute name="dev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<interleave>
<zeroOrMore>
@@ -267,7 +267,7 @@
<interleave>
<element name="scratch">
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<interleave>
<zeroOrMore>
@@ -290,7 +290,7 @@
<interleave>
<element name="scratch">
<attribute name="dev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<interleave>
<zeroOrMore>
diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng
index 595dbcd634..3afc282a2f 100644
--- a/src/conf/schemas/domaincaps.rng
+++ b/src/conf/schemas/domaincaps.rng
@@ -13,7 +13,7 @@
<interleave>
<optional>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<element name="domain">
diff --git a/src/conf/schemas/domaincheckpoint.rng
b/src/conf/schemas/domaincheckpoint.rng
index 72c4186235..188954d19a 100644
--- a/src/conf/schemas/domaincheckpoint.rng
+++ b/src/conf/schemas/domaincheckpoint.rng
@@ -56,7 +56,7 @@
<attribute name="name">
<choice>
<ref name="diskTargetDev"/>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</choice>
</attribute>
<choice>
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 5597d5a66b..c333e3e1e2 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -359,7 +359,7 @@
<ref name="pflashFormat"/>
</optional>
<optional>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</optional>
</element>
</optional>
@@ -367,7 +367,7 @@
<element name="nvram">
<optional>
<attribute name="template">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<optional>
<attribute name="templateFormat">
@@ -381,7 +381,7 @@
<optional>
<choice>
<group>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</group>
<group>
<ref name="diskSource"/>
@@ -480,7 +480,7 @@
</element>
<optional>
<element name="init">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<zeroOrMore>
@@ -500,7 +500,7 @@
</zeroOrMore>
<optional>
<element name="initdir">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<optional>
@@ -995,7 +995,7 @@
<element name="device">
<interleave>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
<optional>
<element name="weight">
@@ -1322,7 +1322,7 @@
<element name="resource">
<optional>
<element name="partition">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<optional>
@@ -1535,17 +1535,17 @@
<interleave>
<optional>
<element name="kernel">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<optional>
<element name="initrd">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<optional>
<element name="root">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<optional>
@@ -1560,7 +1560,7 @@
</optional>
<optional>
<element name="dtb">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
</interleave>
@@ -1892,7 +1892,7 @@
<optional>
<attribute name="file">
<choice>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
<ref name="vmwarePath"/>
</choice>
</attribute>
@@ -1925,7 +1925,7 @@
<optional>
<attribute name="dev">
<choice>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
<ref name="deviceName"/>
</choice>
</attribute>
@@ -1956,7 +1956,7 @@
<element name="source">
<interleave>
<attribute name="dir">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<ref name="diskSourceCommon"/>
<optional>
@@ -2000,7 +2000,7 @@
<value>unix</value>
</attribute>
<attribute name="socket">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
</choice>
@@ -2048,7 +2048,7 @@
<optional>
<element name="config">
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<empty/>
</element>
@@ -2243,7 +2243,7 @@
<define name="diskSourceNetworkProtocolSSHHostVerify">
<element name="knownHosts">
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</element>
</define>
@@ -2256,10 +2256,10 @@
</attribute>
<choice>
<attribute name="keyfile">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<attribute name="agentsock">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</choice>
</interleave>
@@ -2495,7 +2495,7 @@
<value>unix</value>
</attribute>
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<optional>
<ref name="reconnect"/>
@@ -2510,7 +2510,7 @@
</attribute>
<element name="source">
<attribute name="dev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<empty/>
</element>
@@ -3165,7 +3165,7 @@
</optional>
<element name="source">
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<empty/>
</element>
@@ -3182,7 +3182,7 @@
</optional>
<element name="source">
<attribute name="dev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<empty/>
</element>
@@ -3207,12 +3207,12 @@
<choice>
<group>
<attribute name="dir">
- <ref name="absDirPath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
<group>
<attribute name="socket">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
</choice>
@@ -3236,7 +3236,7 @@
</optional>
<element name="source">
<attribute name="dir">
- <ref name="absDirPath"/>
+ <ref name="absolutePath"/>
</attribute>
<empty/>
</element>
@@ -3341,7 +3341,7 @@
<element name="binary">
<optional>
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<optional>
@@ -3495,7 +3495,7 @@
</optional>
<optional>
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<optional>
@@ -3857,7 +3857,7 @@
<optional>
<element name="script">
<attribute name="path">
- <ref name="filePath"/>
+ <ref name="relativePath"/>
</attribute>
<empty/>
</element>
@@ -3865,7 +3865,7 @@
<optional>
<element name="downscript">
<attribute name="path">
- <ref name="filePath"/>
+ <ref name="relativePath"/>
</attribute>
<empty/>
</element>
@@ -3900,17 +3900,17 @@
</optional>
<optional>
<attribute name="tap">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<optional>
<attribute name="vhost">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<optional>
<attribute name="logFile">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</element>
@@ -4195,7 +4195,7 @@
-->
<define name="emulator">
<element name="emulator">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</define>
<!--
@@ -4276,7 +4276,7 @@
<group>
<optional>
<attribute name="socket">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</group>
@@ -4475,7 +4475,7 @@
</attribute>
<optional>
<attribute name="rendernode">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<empty/>
@@ -4509,7 +4509,7 @@
</attribute>
<optional>
<attribute name="rendernode">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</element>
@@ -4587,7 +4587,7 @@
<element name="gl">
<optional>
<attribute name="rendernode">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</element>
@@ -4649,7 +4649,7 @@
</attribute>
<optional>
<attribute name="socket">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</group>
@@ -4766,7 +4766,7 @@
</optional>
<optional>
<attribute name="rendernode">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</element>
@@ -4918,7 +4918,7 @@
<ref name="qemucdevSrcType"/>
<optional>
<attribute name="tty">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<interleave>
@@ -5140,7 +5140,7 @@
<optional>
<element name="log">
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<optional>
<attribute name="append">
@@ -5161,7 +5161,7 @@
<group>
<optional>
<attribute name="tty">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<empty/>
@@ -5297,7 +5297,7 @@
<ref name="audiocommonattr"/>
<optional>
<attribute name="dev">
- <ref name="filePath"/>
+ <ref name="relativePath"/>
</attribute>
</optional>
<ref name="audiocommonchild"/>
@@ -5570,7 +5570,7 @@
</optional>
<optional>
<attribute name="runtimeDir">
- <ref name="filePath"/>
+ <ref name="relativePath"/>
</attribute>
</optional>
</interleave>
@@ -5647,7 +5647,7 @@
</attribute>
<optional>
<attribute name="path">
- <ref name="filePath"/>
+ <ref name="relativePath"/>
</attribute>
</optional>
<interleave>
@@ -5746,7 +5746,7 @@
<element name="server">
<optional>
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</element>
@@ -5911,7 +5911,7 @@
</group>
<optional>
<element name="database">
- <ref name="absDirPath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
</interleave>
@@ -6022,7 +6022,7 @@
<element name="device">
<optional>
<attribute name="path">
- <ref name="filePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
</element>
@@ -6036,7 +6036,7 @@
<value>unix</value>
</attribute>
<attribute name="path">
- <ref name="filePath"/>
+ <ref name="relativePath"/>
</attribute>
<attribute name="mode">
<value>connect</value>
@@ -6054,7 +6054,7 @@
<value>file</value>
</attribute>
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
<group>
@@ -6062,7 +6062,7 @@
<value>dir</value>
</attribute>
<attribute name="path">
- <ref name="absDirPath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
</choice>
@@ -6277,7 +6277,7 @@
</attribute>
<element name="source">
<attribute name="evdev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</element>
</group>
@@ -6287,7 +6287,7 @@
</attribute>
<element name="source">
<attribute name="dev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<optional>
<attribute name="grab">
@@ -6388,7 +6388,7 @@
<interleave>
<optional>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<element name="size">
@@ -6662,7 +6662,7 @@
</attribute>
<element name="source">
<element name="block">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</element>
</define>
@@ -6673,7 +6673,7 @@
</attribute>
<element name="source">
<element name="char">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</element>
</define>
@@ -7245,7 +7245,7 @@
<value>msdm</value>
</choice>
</attribute>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</zeroOrMore>
</element>
@@ -7477,7 +7477,7 @@
</optional>
<optional>
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<empty/>
@@ -7561,7 +7561,7 @@
<group>
<interleave>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
<optional>
<element name="alignsize">
@@ -7673,7 +7673,7 @@
<value>random</value>
</attribute>
<choice>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
<empty/>
</choice>
</group>
@@ -7819,7 +7819,7 @@
<choice>
<group> <!-- old format, for block copy back-compat -->
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<optional>
<attribute name="format">
diff --git a/src/conf/schemas/domainsnapshot.rng b/src/conf/schemas/domainsnapshot.rng
index 2549c47b22..6fbf66da5c 100644
--- a/src/conf/schemas/domainsnapshot.rng
+++ b/src/conf/schemas/domainsnapshot.rng
@@ -46,7 +46,7 @@
</attribute>
</optional>
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</group>
</choice>
@@ -143,7 +143,7 @@
<attribute name="name">
<choice>
<ref name="diskTargetDev"/>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</choice>
</attribute>
<choice>
@@ -171,7 +171,7 @@
<element name="source">
<optional>
<attribute name="file">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
</optional>
<optional>
@@ -201,7 +201,7 @@
<optional>
<element name="source">
<attribute name="dev">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<zeroOrMore>
<ref name="devSeclabel"/>
diff --git a/src/conf/schemas/network.rng b/src/conf/schemas/network.rng
index b7c8551fad..bc170a59b5 100644
--- a/src/conf/schemas/network.rng
+++ b/src/conf/schemas/network.rng
@@ -422,7 +422,7 @@
</zeroOrMore>
<optional>
<element name="bootp">
- <attribute name="file"><ref
name="filePath"/></attribute>
+ <attribute name="file"><ref
name="relativePath"/></attribute>
<optional>
<attribute name="server"><ref
name="dnsName"/></attribute>
</optional>
diff --git a/src/conf/schemas/secret.rng b/src/conf/schemas/secret.rng
index c90e2eb81f..66a66e1c7b 100644
--- a/src/conf/schemas/secret.rng
+++ b/src/conf/schemas/secret.rng
@@ -51,7 +51,7 @@
<value>volume</value>
</attribute>
<element name="volume">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</define>
diff --git a/src/conf/schemas/storagecommon.rng b/src/conf/schemas/storagecommon.rng
index 14704c737e..04a913a776 100644
--- a/src/conf/schemas/storagecommon.rng
+++ b/src/conf/schemas/storagecommon.rng
@@ -82,7 +82,7 @@
<value>unix</value>
</attribute>
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<attribute name="mode">
<choice>
diff --git a/src/conf/schemas/storagepool.rng b/src/conf/schemas/storagepool.rng
index 63a8b75fd8..ec25ac7c25 100644
--- a/src/conf/schemas/storagepool.rng
+++ b/src/conf/schemas/storagepool.rng
@@ -311,7 +311,7 @@
<element name="target">
<interleave>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
<ref name="permissions"/>
</interleave>
@@ -323,7 +323,7 @@
<interleave>
<optional>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
</optional>
<ref name="permissions"/>
@@ -354,7 +354,7 @@
<element name="device">
<attribute name="path">
<choice>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
<ref name="genericName"/>
<ref name="IscsiQualifiedName"/>
</choice>
@@ -395,7 +395,7 @@
<define name="sourceinfodir">
<element name="dir">
<attribute name="path">
- <ref name="absDirPath"/>
+ <ref name="absolutePath"/>
</attribute>
<empty/>
</element>
@@ -404,7 +404,7 @@
<define name="sourceinfonetrelativepath">
<element name="dir">
<attribute name="path">
- <ref name="dirPath"/>
+ <ref name="relativePath"/>
</attribute>
<empty/>
</element>
diff --git a/src/conf/schemas/storagevol.rng b/src/conf/schemas/storagevol.rng
index 3e0f482007..a372c7ab78 100644
--- a/src/conf/schemas/storagevol.rng
+++ b/src/conf/schemas/storagevol.rng
@@ -106,7 +106,7 @@
<element name="path">
<choice>
<data type="anyURI"/>
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</choice>
</element>
</optional>
@@ -138,7 +138,7 @@
<element name="backingStore">
<interleave>
<element name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</element>
<ref name="format"/>
<ref name="permissions"/>
@@ -159,7 +159,7 @@
<define name="sourcedev">
<element name="device">
<attribute name="path">
- <ref name="absFilePath"/>
+ <ref name="absolutePath"/>
</attribute>
<choice>
<empty/>
--
2.49.0