This patch is my first experience playing with nested grammars,
as documented in
http://relaxng.org/tutorial-20011203.html#IDA3PZR.
I plan on doing more overrides in order to make the RelaxNG
grammar mirror the C code refactoring into a common
virStorageSource, but where different clients of that source do
not support the same subset of functionality. By starting with
something fairly easy to validate, I can make sure my later
patches will be possible.
One way to test this patch: s/qed/raw/ in the file
tests/domainsnapshotxml2xmlin/disk_snapshot.xml, then run
make -C tests check TESTS=domainsnapshotschematest. Pre-patch,
the file will pass the schema, even though attempts to use that
description with virDomainSnapshotCreateXML will fail because
raw files cannot have a backing store. Post-patch, the file
will fail virt-xml-validate.
* docs/schemas/domainsnapshot.rng (domain): Use nested grammar
to avoid restricting <domain>.
(storageFormat): Override for tighter usage.
* docs/schemas/storagecommon.rng (startupPolicy): Create a no-op
default.
* docs/schemas/domaincommon.rng (storageFormat): Cross-reference.
(startupPolicy): Move the non-trivial define...
* docs/schemas/domain.rng (startupPolicy): ...here.
Please wait for a v2 on this patch; I'm running into issues with
storageFormat that need to be resolved in a better way.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library