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

Add virConnectGetDomainCapabilities API

Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent 4d8256ff
......@@ -2,7 +2,7 @@ Revision history for perl module Sys::Virt
1.2.7 2014-00-00
- XXX
- Add virConnectGetDomainCapabilities API
1.2.6 2014-07-02
......
......@@ -1997,6 +1997,41 @@ PREINIT:
OUTPUT:
RETVAL
SV *
get_domain_capabilities(con, emulatorsv, archsv, machinesv, virttypesv, flags=0)
virConnectPtr con;
SV *emulatorsv;
SV *archsv;
SV *machinesv;
SV *virttypesv;
unsigned int flags;
PREINIT:
char *emulator = NULL;
char *arch = NULL;
char *machine = NULL;
char *virttype = NULL;
char *xml;
CODE:
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,
flags)))
_croak_error();
RETVAL = newSVpv(xml, 0);
free(xml);
OUTPUT:
RETVAL
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