Commit 2f0fd9ad authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add virConnectGetDomainCapabilities API

Signed-off-by: 's avatarDaniel P. Berrange <>
parent 4d8256ff
......@@ -2,7 +2,7 @@ Revision history for perl module Sys::Virt
1.2.7 2014-00-00
- Add virConnectGetDomainCapabilities API
1.2.6 2014-07-02
......@@ -1997,6 +1997,41 @@ PREINIT:
SV *
get_domain_capabilities(con, emulatorsv, archsv, machinesv, virttypesv, flags=0)
virConnectPtr con;
SV *emulatorsv;
SV *archsv;
SV *machinesv;
SV *virttypesv;
unsigned int flags;
char *emulator = NULL;
char *arch = NULL;
char *machine = NULL;
char *virttype = NULL;
char *xml;
if (SvOK(emulatorsv))
emulator = SvPV_nolen(emulatorsv);
if (SvOK(archsv))
arch = SvPV_nolen(archsv);
if (SvOK(machinesv))
machine = SvPV_nolen(machinesv);
if (SvOK(virttypesv))
virttype = SvPV_nolen(virttypesv);
if (!(xml = virConnectGetDomainCapabilities(con,
emulator, arch,
machine, virttype,
RETVAL = newSVpv(xml, 0);
SV *
compare_cpu(con, xml, flags=0)
......@@ -19,3 +19,7 @@ my @info = $hv->get_node_free_pages([2048], 0, 0);
use Data::Dumper;
print Dumper(\@info);
my $xml = $hv->get_domain_capabilities(undef, "x86_64", undef, "kvm");
print $xml;
......@@ -1610,6 +1610,16 @@ specifying the 'domain of interpretation' for security labels.
Returns an XML document describing the hypervisor capabilities
=item my $xml = $con->get_capabilities($emulator, $arch, $machine, $virttype, flags=0);
Returns an XML document describing the capabilities of the
requested guest configuration. Either C<$emulator> or C<$arch>
must be a valid string referring to an emulator binary or an
architecture name respectively. The C<$machine> parameter is
an optional name of a guest machine, and C<$virttype> is an
optional name of the virtualization type. C<$flags> is unused
and defaults to zero.
=item my $result = $con->compare_cpu($xml, $flags=0);
Checks whether the CPU definition in C<$xml> is compatible with the
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment