I first noticed a problem when I added a <memoryBacking> element at an unusual (but still correct) place in the domain XML, and validation failed. Then I tried adding that element in several different places and it failed in many, but not all of them. (NB: from here on, I will use '' for the names of attributes in the domain XML, <> for elements in the domain XML, and "" for the names of grammar rule definitions in the RNG file, and "<>" for the names of elements in the RNG file's own XML. Confused yet? If so, please tell me a better way - everything I know about RNG I've picked up informally by looking at examples in already existing RNG files) Starting from the top level of the grammar for <domain> ("domaincontents" in domaincommon.rng), I noticed that 1) the "<attribute>" for the 'id' attribute of <domain> is defined inside an "<interleave>" down in the definition of "ids" (which is referenced from "domaincontents") (I'm not familiar with the nomenclature - does that make it a "sub-grammer", "child-grammar", ???) 2) although the definition of "ids", had all of its "<attribute>"s/"<element>"s inside an "<interleave>", "domaincontents" already had the reference to "ids" inside an "<interleave>", so there were nested "<interleave>"s. It's not clear to me how an "<attribute>" or "<interleave>" inside another "<interleave>" is supposed to behave, but they both seemed a bit suspicious. I tried all of the below modifications: 1) moving the grammar for the 'id' attribute out of the "<interleave>" but still inside "ids" 2) moving the grammer for the 'id' attribute directly into "domaincontents" (and outside of its "interleave" 3) removing the "<interleave>" that was inside "ids" 4) (2) + (3) 5) move the entire grammar rule "ids" up directly in place of <ref name="ids"> in "domaincontents". 6) (5), but with the grammar for the 'id' attribute moved outside of the "<interleave>" (6) was the only change that allowed all of the following (using modifications to the subelements of <domain> in net-vhostuser-passt.xml as example): a) a <memoryBacking> element in between *any* two existing elements b) moving <name> in between any two elements c) oddly, in addition to the problem with putting <memoryBacking> in odd places, I also found that the original RNG did not allow the <clock> element to be placed in between <on_poweroff> and <on_reboot>, but once I'd made the change in (6), this was no longer problematic. Why should this have any effect? No idea, but it works :-/ (NB: there are many other cases of referencing "sub-grammar" from inside an "<interleave>", and they all seem to work just fine; possibly in this case it was problematic because the sub-grammar a) also contained an "<interleave>", b) had an "<attribute>" at its toplevel, or c) had multiple "<element>"s.) (inexplicably (to me) at one point during my experimentation, I tried reordering the references to "clock", "resources", "features", and "events", and that *also* made it legal to put a <clock> element in between the <on_*> elements:-O) Since I was no longer able to reproduce the error described in (c) once I had made mod (6) (move all of "ids" directly into "domaincontent", I decided it was pointless for me to spend any more time randomly poking and just add that to the new test case for that in case some other random change to the RNG causes it to start failing again. (I thought of writing a test program that would try all possible orderings of the subelements of <domain>, but since doing that for even 10 subelements would mean testing > 3.2 million different XML documents, I decided we could continue in this adhoc manner, just adding a single new test case if/when a new validation failure is found.) Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Libvirt API for virtualization
Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users.
Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP.
Further information about the libvirt project can be found on the website:
License
The libvirt C API is distributed under the terms of GNU Lesser
General Public License, version 2.1 (or later). Some parts of the code
that are not part of the C library may have the more restrictive GNU
General Public License, version 2.0 (or later). See the files
COPYING.LESSER
and COPYING
for full license
terms & conditions.
Installation
Instructions on building and installing libvirt can be found on the website:
https://libvirt.org/compiling.html
Contributing
The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website:
https://libvirt.org/contribute.html
Contact
The libvirt project has two primary mailing lists:
- users@lists.libvirt.org (for user discussions)
- devel@lists.libvirt.org (for development only)
Further details on contacting the project are available on the website: