On 01/04/13 20:00, Han Cheng wrote:
The definiton of scsi adapter in storagespool.rng can be used by
scsi
hostdev. Split storagepool.rng into storagepool.rng and
storagepoolcommon.rng and make domaincomman.rng include the latter one.
Don't think it worth having a separate file, IMHO just moving the
scsi adapter definition into basictypes.rng is enough. And on the
other hand, you have to modify docs/schemas/Makefile.am if
going this way.
PortNumber is both defined in domaincomman.rng and storagespool.rng,
s/is both defined in/is defined in both/,
s/domaincomman/domaincommon/
simplify it.
Signed-off-by: Han Cheng <hanc.fnst(a)cn.fujitsu.com>
---
docs/schemas/domaincommon.rng | 6 +-----
docs/schemas/storagepool.rng | 18 ++----------------
docs/schemas/storagepoolcommon.rng | 21 +++++++++++++++++++++
3 files changed, 24 insertions(+), 21 deletions(-)
create mode 100644 docs/schemas/storagepoolcommon.rng
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index ccf0913..364abf1 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3,6 +3,7 @@
<!-- domain-related definitions used in multiple grammars -->
<include href='basictypes.rng'/>
<include href='storageencryption.rng'/>
+ <include href='storagepoolcommon.rng'/>
<include href='networkcommon.rng'/>
<!--
@@ -3815,11 +3816,6 @@
<param name="minInclusive">-1</param>
</data>
</define>
- <define name="PortNumber">
- <data type="short">
- <param name="minInclusive">-1</param>
- </data>
- </define>
<!-- weight currently is in range [100, 1000] -->
<define name="weight">
<data type="unsignedInt">
diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng
index 0cc0406..8265eff 100644
--- a/docs/schemas/storagepool.rng
+++ b/docs/schemas/storagepool.rng
@@ -3,11 +3,12 @@
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href='basictypes.rng'/>
+ <include href='storagepoolcommon.rng'/>
+
<start>
<ref name='pool'/>
</start>
-
<define name='pool'>
<element name='pool'>
<choice>
@@ -274,15 +275,6 @@
</element>
</define>
- <define name='sourceinfoadapter'>
- <element name='adapter'>
- <attribute name='name'>
- <text/>
- </attribute>
- <empty/>
- </element>
- </define>
-
<define name='sourceinfoname'>
<element name='name'>
<text/>
@@ -525,10 +517,4 @@
</data>
</define>
- <define name="PortNumber">
- <data type="short">
- <param name="minInclusive">-1</param>
- </data>
- </define>
-
</grammar>
diff --git a/docs/schemas/storagepoolcommon.rng b/docs/schemas/storagepoolcommon.rng
new file mode 100644
index 0000000..200855e
--- /dev/null
+++ b/docs/schemas/storagepoolcommon.rng
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!-- A Relax NG schema for the libvirt storage pool XML format -->
+<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
+
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <define name="PortNumber">
+ <data type="short">
+ <param name="minInclusive">-1</param>
+ </data>
+ </define>
+
+ <define name='sourceinfoadapter'>
+ <element name='adapter'>
+ <attribute name='name'>
+ <text/>
+ </attribute>
+ <empty/>
+ </element>
+ </define>
+
+</grammar>