[libvirt] [PATCH] Correct invalid RNG schemas.

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 <mkletzan@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> <value>root</value> <data type="string"> - <param name="pattern">mac[a-zA-Z0-9_\.:-]{0,9}</param> + <param name="pattern">mac[a-zA-Z0-9_\.:\-]{0,9}</param> </data> <data type="string"> - <param name="pattern">stp[a-zA-Z0-9_\.:-]{0,9}</param> + <param name="pattern">stp[a-zA-Z0-9_\.:\-]{0,9}</param> </data> <data type="string"> - <param name="pattern">vlan[a-zA-Z0-9_\.:-]{0,8}</param> + <param name="pattern">vlan[a-zA-Z0-9_\.:\-]{0,8}</param> </data> <data type="string"> - <param name="pattern">arp[a-zA-Z0-9_\.:-]{0,9}</param> + <param name="pattern">arp[a-zA-Z0-9_\.:\-]{0,9}</param> </data> <data type="string"> - <param name="pattern">rarp[a-zA-Z0-9_\.:-]{0,8}</param> + <param name="pattern">rarp[a-zA-Z0-9_\.:\-]{0,8}</param> </data> <data type="string"> - <param name="pattern">ipv4[a-zA-Z0-9_\.:-]{0,8}</param> + <param name="pattern">ipv4[a-zA-Z0-9_\.:\-]{0,8}</param> </data> <data type="string"> - <param name="pattern">ipv6[a-zA-Z0-9_\.:-]{0,8}</param> + <param name="pattern">ipv6[a-zA-Z0-9_\.:\-]{0,8}</param> </data> </choice> </attribute> @@ -950,10 +950,7 @@ <param name="pattern">0x[0-9a-fA-F]{1,8}</param> </data> - <data type="int"> - <param name="minInclusive">0</param> - <param name="maxInclusive">4294967295</param> - </data> + <data type="unsignedInt"/> </choice> </define> -- 1.8.1.5

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 <mkletzan@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

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 <mkletzan@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
participants (2)
-
Ján Tomko
-
Martin Kletzander