This patch:
* Adds virConnectGetCapabilities which returns an XML description of the
capabilities of the driver or hypervisor under this connection (see
below for more about the XML format).
* Adds virsh capabilities command.
* Checks the Python binding works.
Caveats:
* Xen implementation (in xen_internal.c) is not tested because I don't
have a working Xen machine right now. QEMU, test and remote work however.
Example:
$ virsh -c test:///default capabilities | tidy -xml -i -q
<capabilities>
<domain>
<type>test</type>
</domain>
<host_features></host_features>
<guest_architectures>
<guest_architecture>
<model>i686</model>
<bits>32</bits>
<guest_features>
<accelerated />
<pae />
</guest_features>
</guest_architecture>
</guest_architectures>
</capabilities>
$ virsh -c qemu:///session capabilities | tidy -xml -i -q
<capabilities>
<domain>
<type>qemu</type>
</domain>
<guest_architectures>
<guest_architecture>
<model>i686</model>
<bits>32</bits>
<features>
<emulated />
</features>
</guest_architecture>
<guest_architecture>
<model>x86_64</model>
<bits>64</bits>
<features>
<emulated />
</features>
</guest_architecture>
[... other archs deleted ...]
</guest_architectures>
</capabilities>
XML format:
The <capabilities> node contains information about the host and a list
of supported architectures for guests. About the host we return:
<domain>
<type> The default type acceptable when creating a domain.
<host_features>
<hvm> Does the host CPU support HVM?
<type> Type of HVM (eg. "vmx")
<bios_setting> "enabled" or "disabled"
About the guest architectures we can return:
<guest_architecture>
<model> The (virtualised) CPU
<bits> Bits
<domain>
<type> If different from the default type (eg. for kqemu)
<features>
<hvm> Full virt guest?
<accelerated> Accelerated (eg. Xen or kqemu)
<emulated> Emulated (eg. qemu or bochs)
(and a few other esoteric flags here)
Rich.
--
Emerging Technologies, Red Hat
http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421
"[Negative numbers] darken the very whole doctrines of the equations
and make dark of the things which are in their nature excessively
obvious and simple" (Francis Maseres FRS, mathematician, 1759)