Commit f123d356 authored by Michal Privoznik's avatar Michal Privoznik Committed by Daniel P. Berrangé

Add virConnectGetStoragePoolCapabilities binding

Signed-off-by: 's avatarMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
parent b5f3e426
......@@ -7,6 +7,7 @@ Revision history for perl module Sys::Virt
- Add VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY constant
- Add VIR_DOMAIN_SAVE_IMAGE_XML_SECURE and
VIR_DOMAIN_SNAPSHOT_XML_SECURE constants
- Add virConnectGetStoragePoolCapabilities binding
5.0.0 2019-01-21
......
......@@ -4,6 +4,8 @@ use strict;
use warnings;
use Sys::Virt;
use XML::XPath;
use XML::XPath::XMLParser;
my $addr = @ARGV ? shift @ARGV : "";
......@@ -33,5 +35,16 @@ foreach my $info (@info) {
print "\n";
}
my $poolCaps = $hv->get_storage_pool_capabilities();
my @poolTypes = ();
my $xp = XML::XPath->new(xml => $poolCaps);
my $nodeset = $xp->find('/storagepoolCapabilities/pool[@supported="yes"]/@type');
foreach my $node ($nodeset->get_nodelist) {
push (@poolTypes, $node->getNodeValue());
}
print "Supported pool types: @poolTypes\n";
my $xml = $hv->get_domain_capabilities(undef, "x86_64", undef, "kvm");
print $xml;
......@@ -1869,6 +1869,12 @@ 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 $xml = $con->get_storage_pool_capabilities($flags=0);
Returns an XML document describing the storage pool driver
capabilities (e.g. which storage pool types are supported and so
on). C<$flags> is currently 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
......
......@@ -2774,6 +2774,22 @@ PREINIT:
RETVAL
SV *
get_storage_pool_capabilities(con, flags=0)
virConnectPtr con;
unsigned int flags;
PREINIT:
char *xml;
CODE:
if (!(xml = virConnectGetStoragePoolCapabilities(con, flags)))
_croak_error();
RETVAL = newSVpv(xml, 0);
free(xml);
OUTPUT:
RETVAL
SV *
compare_cpu(con, xml, flags=0)
virConnectPtr con;
......
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