mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
schema: Add define for object names
Objects such as domain, pool, etc re-define the regex for the format. Add more generic types for objects with/without a slash which we'll be able to reuse also for other objects. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e955106195
commit
1a3c07989b
@ -261,6 +261,19 @@
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<!-- objectName represents any generic string for naming objects like domain -->
|
||||
<define name="objectNameWithSlash">
|
||||
<data type="string">
|
||||
<param name="pattern">[^\n]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name="objectName">
|
||||
<data type="string">
|
||||
<param name="pattern">[^/\n]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name="genericName">
|
||||
<data type="string">
|
||||
<param name="pattern">[a-zA-Z0-9_\+\-]+</param>
|
||||
|
@ -18,9 +18,7 @@
|
||||
|
||||
<define name="title">
|
||||
<element name="title">
|
||||
<data type="string">
|
||||
<param name="pattern">[^\n]+</param>
|
||||
</data>
|
||||
<ref name="objectNameWithSlash"/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@ -559,7 +557,7 @@
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="name">
|
||||
<ref name="domainName"/>
|
||||
<ref name="objectNameWithSlash"/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name="uuid">
|
||||
@ -1391,7 +1389,7 @@
|
||||
<optional>
|
||||
<element name="backenddomain">
|
||||
<attribute name="name">
|
||||
<ref name="domainName"/>
|
||||
<ref name="objectNameWithSlash"/>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
@ -2056,7 +2054,7 @@
|
||||
<element name="source">
|
||||
<interleave>
|
||||
<attribute name="pool">
|
||||
<ref name="poolName"/>
|
||||
<ref name="objectName"/>
|
||||
</attribute>
|
||||
<attribute name="volume">
|
||||
<ref name="volName"/>
|
||||
@ -3269,7 +3267,7 @@
|
||||
<optional>
|
||||
<element name="backenddomain">
|
||||
<attribute name="name">
|
||||
<ref name="domainName"/>
|
||||
<ref name="objectNameWithSlash"/>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
@ -6944,11 +6942,6 @@
|
||||
<param name="maxInclusive">1000</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="domainName">
|
||||
<data type="string">
|
||||
<param name="pattern">[^\n]+</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="diskSerial">
|
||||
<data type="string">
|
||||
<param name="pattern">[A-Za-z0-9_\.\+\- ]+</param>
|
||||
|
@ -6,12 +6,6 @@
|
||||
<!-- This schema is not designed for standalone use; another file
|
||||
must include both this file and basictypes.rng -->
|
||||
|
||||
<define name="poolName">
|
||||
<data type="string">
|
||||
<param name="pattern">[^/\n]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name="encryption">
|
||||
<element name="encryption">
|
||||
<attribute name="format">
|
||||
|
@ -247,7 +247,7 @@
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name="name">
|
||||
<ref name="poolName"/>
|
||||
<ref name="objectName"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
@ -261,7 +261,7 @@
|
||||
<define name="commonmetadata">
|
||||
<interleave>
|
||||
<element name="name">
|
||||
<ref name="poolName"/>
|
||||
<ref name="objectName"/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name="uuid">
|
||||
|
Loading…
x
Reference in New Issue
Block a user