[libsys-virt-perl] 01/01: Imported Upstream version 1.1.3
Salvatore Bonaccorso
carnil at debian.org
Thu Oct 3 21:24:00 UTC 2013
This is an automated email from the git hooks/post-receive script.
carnil pushed a commit to annotated tag upstream/1.1.3
in repository libsys-virt-perl.
commit 748b42529a691b74ae20cc3a4344bfad82f2dd17
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Thu Oct 3 23:22:30 2013 +0200
Imported Upstream version 1.1.3
---
Changes | 4 ++++
MANIFEST | 1 +
META.yml | 2 +-
MYMETA.json | 2 +-
MYMETA.yml | 2 +-
Makefile.PL | 2 +-
README | 2 +-
Virt.xs | 21 +++++++++++++++++++++
examples/node-info.pl | 16 ++++++++++++++++
lib/Sys/Virt.pm | 10 +++++++++-
perl-Sys-Virt.spec | 2 +-
t/100-connect.t | 6 +++++-
12 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/Changes b/Changes
index 9a781e8..814428e 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
Revision history for perl module Sys::Virt
+1.1.3 2013-10-02
+
+ - Add all new APIs in libvirt 1.1.3
+
1.1.2 2013-09-27
- Add all new constants in libvirt 1.1.2
diff --git a/MANIFEST b/MANIFEST
index 89d8964..40cee20 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -9,6 +9,7 @@ examples/events.pl
examples/hv-stat.pl
examples/node-cpu.pl
examples/node-devlist.pl
+examples/node-info.pl
examples/node-ksm.pl
examples/open-console.pl
examples/save-restore.pl
diff --git a/META.yml b/META.yml
index 940d0c6..93071b0 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
--- #YAML:1.0
name: Sys-Virt
abstract: Extension for the libvirt library
-version: 1.1.2
+version: 1.1.3
author:
- Daniel P. Berrange <dan at berrange.com>
license: perl
diff --git a/MYMETA.json b/MYMETA.json
index 1d9a316..5a54585 100644
--- a/MYMETA.json
+++ b/MYMETA.json
@@ -42,5 +42,5 @@
}
},
"release_status" : "stable",
- "version" : "v1.1.2"
+ "version" : "v1.1.3"
}
diff --git a/MYMETA.yml b/MYMETA.yml
index 9ca329b..ba58813 100644
--- a/MYMETA.yml
+++ b/MYMETA.yml
@@ -24,4 +24,4 @@ requires:
Test::Pod::Coverage: 0
Time::HiRes: 0
XML::XPath: 0
-version: v1.1.2
+version: v1.1.3
diff --git a/Makefile.PL b/Makefile.PL
index 7a439b0..e812653 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-my $libvirtver = "1.1.2";
+my $libvirtver = "1.1.3";
my $stat = system "pkg-config --atleast-version=$libvirtver libvirt";
die "cannot run pkg-config to check libvirt version" if $stat == -1;
die "libvirt >= $libvirtver is required\n" unless $stat == 0;
diff --git a/README b/README
index b0a13ab..2c13abe 100644
--- a/README
+++ b/README
@@ -7,6 +7,6 @@ further details on libvirt consult its website http://libvirt.org/
The only pre-requisite for this module is libvirt itself. For
installation instructions, consult the INSTALL file.
-The current minimum required version of libvirt is 1.1.2
+The current minimum required version of libvirt is 1.1.3
-- End
diff --git a/Virt.xs b/Virt.xs
index 3f2a453..46d08de 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -1907,6 +1907,27 @@ PREINIT:
OUTPUT:
RETVAL
+void
+get_cpu_model_names(con, arch, flags=0)
+ virConnectPtr con;
+ char *arch;
+ unsigned int flags;
+PREINIT:
+ int nnames;
+ int i;
+ char **names = NULL;
+ PPCODE:
+ if ((nnames = virConnectGetCPUModelNames(con, arch, &names, flags)) < 0)
+ _croak_error();
+
+ EXTEND(SP, nnames);
+ for (i = 0 ; i < nnames ; i++) {
+ PUSHs(sv_2mortal(newSVpv(names[i], 0)));
+ free(names[i]);
+ }
+ Safefree(names);
+
+
int
get_max_vcpus(con, type)
diff --git a/examples/node-info.pl b/examples/node-info.pl
new file mode 100644
index 0000000..6d25b90
--- /dev/null
+++ b/examples/node-info.pl
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Sys::Virt;
+
+my $addr = @ARGV ? shift @ARGV : "";
+
+my $hv = Sys::Virt->new(address => $addr, readonly => 1);
+
+my $info = $hv->get_node_info();
+
+my @models = $hv->get_cpu_model_names($info->{model});
+
+print join ("\n", sort{ lc $a cmp lc $b } @models), "\n";
diff --git a/lib/Sys/Virt.pm b/lib/Sys/Virt.pm
index 7a7722d..96357a7 100644
--- a/lib/Sys/Virt.pm
+++ b/lib/Sys/Virt.pm
@@ -78,7 +78,7 @@ use Sys::Virt::NWFilter;
use Sys::Virt::DomainSnapshot;
use Sys::Virt::Stream;
-our $VERSION = '1.1.2';
+our $VERSION = '1.1.3';
require XSLoader;
XSLoader::load('Sys::Virt', $VERSION);
@@ -1559,6 +1559,14 @@ implied by the model name.
=back
+=item @names = $con->get_cpu_model_names($arch, $flags=0)
+
+Get a list of valid CPU models names for the architecture
+given by C<$arch>. The C<$arch> value should be one of the
+architectures listed in the capabilities XML document.
+The C<$flags> parameter is currently unused and defaults
+to 0.
+
=item my $info = $con->get_node_security_model()
Returns a hash reference summarising the security model of the
diff --git a/perl-Sys-Virt.spec b/perl-Sys-Virt.spec
index 630832f..e0940df 100644
--- a/perl-Sys-Virt.spec
+++ b/perl-Sys-Virt.spec
@@ -1,7 +1,7 @@
# Automatically generated by perl-Sys-Virt.spec.PL
Name: perl-Sys-Virt
-Version: 1.1.2
+Version: 1.1.3
Release: 1%{?dist}%{?extra_release}
Summary: Represent and manage a libvirt hypervisor connection
License: GPLv2+ or Artistic
diff --git a/t/100-connect.t b/t/100-connect.t
index ff6d115..884441f 100644
--- a/t/100-connect.t
+++ b/t/100-connect.t
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 24;
+use Test::More tests => 25;
use XML::XPath;
use XML::XPath::XMLParser;
use Sys::Hostname;
@@ -77,3 +77,7 @@ SKIP: {
ok($conn->is_secure(), "connection is secure");
ok(!$conn->is_encrypted(), "connection is not encrypted");
+
+my @models = $conn->get_cpu_model_names($info->{model});
+
+ok($#models > -1, "got some cpu models");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libsys-virt-perl.git
More information about the Pkg-perl-cvs-commits
mailing list