[libvirt] [PATCH] Correct invalid RNG schemas.

2013-03-21 Thread Martin Kletzander
The 'trang' utility, which is able to transform '.rng' files into
'.rnc' files, reported some errors in our schemas that weren't caught
by the tools we use in the build.  I haven't added a test for this,
but the validity can be checked by the following command:

trang -I rng -O rnc domain.rng domain.rnc

There were unescaped minuses in regular expressions and we were
constraining int (which is by default in the range of [-2^31;2^31-1]
to maximum of 2^32.  But what we wanted was exactly an unsignedInt.

Signed-off-by: Martin Kletzander mklet...@redhat.com
---
Thanks to that, the '.rnc' files can be used by nxml-mode which makes
editing libvirt xml files a *lot* easier.

 docs/schemas/domaincommon.rng |  2 +-
 docs/schemas/nwfilter.rng | 19 ---
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index c4e7b7a..3240e1c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3929,7 +3929,7 @@
   /define
   define name='aliasName'
 data type=string
-  param name=pattern[a-zA-Z0-9_-]+/param
+  param name=pattern[a-zA-Z0-9_\-]+/param
 /data
   /define
   define name='alias'
diff --git a/docs/schemas/nwfilter.rng b/docs/schemas/nwfilter.rng
index cfd9ba5..f1aa699 100644
--- a/docs/schemas/nwfilter.rng
+++ b/docs/schemas/nwfilter.rng
@@ -308,25 +308,25 @@
 choice
   valueroot/value
   data type=string
-param name=patternmac[a-zA-Z0-9_\.:-]{0,9}/param
+param name=patternmac[a-zA-Z0-9_\.:\-]{0,9}/param
   /data
   data type=string
-param name=patternstp[a-zA-Z0-9_\.:-]{0,9}/param
+param name=patternstp[a-zA-Z0-9_\.:\-]{0,9}/param
   /data
   data type=string
-param name=patternvlan[a-zA-Z0-9_\.:-]{0,8}/param
+param name=patternvlan[a-zA-Z0-9_\.:\-]{0,8}/param
   /data
   data type=string
-param name=patternarp[a-zA-Z0-9_\.:-]{0,9}/param
+param name=patternarp[a-zA-Z0-9_\.:\-]{0,9}/param
   /data
   data type=string
-param name=patternrarp[a-zA-Z0-9_\.:-]{0,8}/param
+param name=patternrarp[a-zA-Z0-9_\.:\-]{0,8}/param
   /data
   data type=string
-param name=patternipv4[a-zA-Z0-9_\.:-]{0,8}/param
+param name=patternipv4[a-zA-Z0-9_\.:\-]{0,8}/param
   /data
   data type=string
-param name=patternipv6[a-zA-Z0-9_\.:-]{0,8}/param
+param name=patternipv6[a-zA-Z0-9_\.:\-]{0,8}/param
   /data
 /choice
   /attribute
@@ -950,10 +950,7 @@
 param name=pattern0x[0-9a-fA-F]{1,8}/param
   /data

-  data type=int
-param name=minInclusive0/param
-param name=maxInclusive4294967295/param
-  /data
+  data type=unsignedInt/
 /choice
   /define

--
1.8.1.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Correct invalid RNG schemas.

2013-03-21 Thread Ján Tomko
On 03/21/2013 04:28 PM, Martin Kletzander wrote:
 The 'trang' utility, which is able to transform '.rng' files into
 '.rnc' files, reported some errors in our schemas that weren't caught
 by the tools we use in the build.  I haven't added a test for this,
 but the validity can be checked by the following command:
 
 trang -I rng -O rnc domain.rng domain.rnc
 
 There were unescaped minuses in regular expressions and we were
 constraining int (which is by default in the range of [-2^31;2^31-1]
 to maximum of 2^32.  But what we wanted was exactly an unsignedInt.
 
 Signed-off-by: Martin Kletzander mklet...@redhat.com
 ---
 Thanks to that, the '.rnc' files can be used by nxml-mode which makes
 editing libvirt xml files a *lot* easier.
 
  docs/schemas/domaincommon.rng |  2 +-
  docs/schemas/nwfilter.rng | 19 ---
  2 files changed, 9 insertions(+), 12 deletions(-)

ACK

Jan

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Correct invalid RNG schemas.

2013-03-21 Thread Martin Kletzander
On 03/21/2013 05:00 PM, Ján Tomko wrote:
 On 03/21/2013 04:28 PM, Martin Kletzander wrote:
 The 'trang' utility, which is able to transform '.rng' files into
 '.rnc' files, reported some errors in our schemas that weren't caught
 by the tools we use in the build.  I haven't added a test for this,
 but the validity can be checked by the following command:

 trang -I rng -O rnc domain.rng domain.rnc

 There were unescaped minuses in regular expressions and we were
 constraining int (which is by default in the range of [-2^31;2^31-1]
 to maximum of 2^32.  But what we wanted was exactly an unsignedInt.

 Signed-off-by: Martin Kletzander mklet...@redhat.com
 ---
 Thanks to that, the '.rnc' files can be used by nxml-mode which makes
 editing libvirt xml files a *lot* easier.

  docs/schemas/domaincommon.rng |  2 +-
  docs/schemas/nwfilter.rng | 19 ---
  2 files changed, 9 insertions(+), 12 deletions(-)
 
 ACK
 
 Jan
 

Thanks, pushed (and removed the dot at the end of subject).

Martin

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list