[libsys-virt-perl] 01/04: Imported Upstream version 1.1.2

Salvatore Bonaccorso carnil at debian.org
Fri Sep 27 20:49:52 UTC 2013


This is an automated email from the git hooks/post-receive script.

carnil pushed a commit to annotated tag debian/1.1.2-1
in repository libsys-virt-perl.

commit cfb0d68691e59f7d0e64c33b0496d50a5cdc1917
Author: Salvatore Bonaccorso <carnil at debian.org>
Date:   Fri Sep 27 22:43:40 2013 +0200

    Imported Upstream version 1.1.2
---
 Changes                  |    4 ++++
 MANIFEST                 |    1 +
 META.yml                 |    2 +-
 MYMETA.json              |    2 +-
 MYMETA.yml               |    2 +-
 Makefile.PL              |    2 +-
 README                   |    2 +-
 Virt.xs                  |   29 +++++++++++++++++++++++------
 examples/node-devlist.pl |   11 +++++++++++
 examples/vcpuinfo.pl     |    4 ++--
 lib/Sys/Virt.pm          |   13 +++++++++++--
 lib/Sys/Virt/Domain.pm   |   12 +++++++++---
 perl-Sys-Virt.spec       |    2 +-
 13 files changed, 67 insertions(+), 19 deletions(-)

diff --git a/Changes b/Changes
index 3996e1e..9a781e8 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for perl module Sys::Virt
 
+1.1.2 2013-09-27
+
+ - Add all new constants in libvirt 1.1.2
+
 1.1.1 2013-07-30
 
  - Add all new constants/apis in libvirt 1.1.1
diff --git a/MANIFEST b/MANIFEST
index acb10a4..89d8964 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -8,6 +8,7 @@ examples/emulator-pin.pl
 examples/events.pl
 examples/hv-stat.pl
 examples/node-cpu.pl
+examples/node-devlist.pl
 examples/node-ksm.pl
 examples/open-console.pl
 examples/save-restore.pl
diff --git a/META.yml b/META.yml
index 0f0d064..940d0c6 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.1
+version:      1.1.2
 author:
   - Daniel P. Berrange <dan at berrange.com>
 license: perl
diff --git a/MYMETA.json b/MYMETA.json
index 9ab3a29..1d9a316 100644
--- a/MYMETA.json
+++ b/MYMETA.json
@@ -42,5 +42,5 @@
       }
    },
    "release_status" : "stable",
-   "version" : "v1.1.1"
+   "version" : "v1.1.2"
 }
diff --git a/MYMETA.yml b/MYMETA.yml
index ed70ed6..9ca329b 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.1
+version: v1.1.2
diff --git a/Makefile.PL b/Makefile.PL
index 22c5285..7a439b0 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.1";
+my $libvirtver = "1.1.2";
 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 6b3008e..b0a13ab 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.1
+The current minimum required version of libvirt is 1.1.2
 
 -- End
diff --git a/Virt.xs b/Virt.xs
index aa4a795..3f2a453 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -4370,12 +4370,21 @@ get_vcpu_info(dom, flags=0)
 
       maplen = VIR_CPU_MAPLEN(VIR_NODEINFO_MAXCPUS(nodeinfo));
       Newx(cpumaps, dominfo.nrVirtCpu * maplen, unsigned char);
-      if (flags && (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
-          Newx(info, dominfo.nrVirtCpu, virVcpuInfo);
+      if (!flags) {
+	  Newx(info, dominfo.nrVirtCpu, virVcpuInfo);
           if ((nvCpus = virDomainGetVcpus(dom, info, dominfo.nrVirtCpu, cpumaps, maplen)) < 0) {
+              virErrorPtr err = virGetLastError();
               Safefree(info);
-              Safefree(cpumaps);
-              _croak_error();
+              info = NULL;
+              if (err && err->code == VIR_ERR_OPERATION_INVALID) {
+                  if ((nvCpus = virDomainGetVcpuPinInfo(dom, dominfo.nrVirtCpu, cpumaps, maplen, flags)) < 0) {
+                      Safefree(cpumaps);
+                      _croak_error();
+                  }
+              } else {
+                  Safefree(cpumaps);
+                  _croak_error();
+              }
           }
       } else {
           info = NULL;
@@ -4393,6 +4402,10 @@ get_vcpu_info(dom, flags=0)
               (void)hv_store(rec, "state", 5, newSViv(info[i].state), 0);
               (void)hv_store(rec, "cpuTime", 7, virt_newSVull(info[i].cpuTime), 0);
               (void)hv_store(rec, "cpu", 3, newSViv(info[i].cpu), 0);
+          } else {
+              (void)hv_store(rec, "state", 5, newSViv(0), 0);
+              (void)hv_store(rec, "cpuTime", 7, virt_newSVull(0), 0);
+              (void)hv_store(rec, "cpu", 3, newSViv(0), 0);
           }
           (void)hv_store(rec, "affinity", 8, newSVpvn((char*)cpumaps + (i *maplen), maplen), 0);
           PUSHs(newRV_noinc((SV *)rec));
@@ -5390,8 +5403,10 @@ const char *
 get_parent(dev)
       virNodeDevicePtr dev;
     CODE:
-      if (!(RETVAL = virNodeDeviceGetParent(dev)))
-          _croak_error();
+      if (!(RETVAL = virNodeDeviceGetParent(dev))) {
+          if (virGetLastError() != NULL)
+              _croak_error();
+      }
   OUTPUT:
       RETVAL
 
@@ -6460,6 +6475,7 @@ BOOT:
       REGISTER_CONSTANT_STR(VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE, NODE_MEMORY_SHARED_PAGES_VOLATILE);
       REGISTER_CONSTANT_STR(VIR_NODE_MEMORY_SHARED_FULL_SCANS, NODE_MEMORY_SHARED_FULL_SCANS);
 
+      REGISTER_CONSTANT(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, BASELINE_CPU_EXPAND_FEATURES);
 
       stash = gv_stashpv( "Sys::Virt::Event", TRUE );
 
@@ -6766,6 +6782,7 @@ BOOT:
       REGISTER_CONSTANT(VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX, EVENT_GRAPHICS_ADDRESS_UNIX);
 
       REGISTER_CONSTANT(VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START, EVENT_DISK_CHANGE_MISSING_ON_START);
+      REGISTER_CONSTANT(VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START, EVENT_DISK_DROP_MISSING_ON_START);
 
       REGISTER_CONSTANT(VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN, EVENT_TRAY_CHANGE_OPEN);
       REGISTER_CONSTANT(VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE, EVENT_TRAY_CHANGE_CLOSE);
diff --git a/examples/node-devlist.pl b/examples/node-devlist.pl
new file mode 100644
index 0000000..59f6a82
--- /dev/null
+++ b/examples/node-devlist.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use Sys::Virt;
+
+my $conn = Sys::Virt->new();
+
+my @nodelist = $conn->list_all_node_devices();
+foreach my $dev (@nodelist){
+    my $parent = $dev->get_parent();
+    printf "%s: < %s\n", $dev->get_name(), $parent;
+}
diff --git a/examples/vcpuinfo.pl b/examples/vcpuinfo.pl
index 668a0aa..6b07433 100644
--- a/examples/vcpuinfo.pl
+++ b/examples/vcpuinfo.pl
@@ -9,12 +9,12 @@ my $con = Sys::Virt->new(address => $addr, readonly => 1);
 
 print "VMM type: ", $con->get_type(), "\n";
 
-foreach my $dom (sort { $a->get_id <=> $b->get_id } $con->list_domains) {
+foreach my $dom (sort { $a->get_id <=> $b->get_id } $con->list_all_domains) {
     print "Domain: {\n";
     print "  ID: ", $dom->get_id(), " '" , $dom->get_name(), "'\n";
     print "  UUID: ", $dom->get_uuid_string(), "\n";
     my $nodeinfo = $con->get_node_info;
-    my @info = $dom->get_vcpu_info;
+    my @info = $dom->get_vcpu_info(Sys::Virt::Domain::AFFECT_CONFIG);
 
     foreach my $info (@info) {
 	print "  VCPU: {\n";
diff --git a/lib/Sys/Virt.pm b/lib/Sys/Virt.pm
index 484fb07..7a7722d 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.1';
+our $VERSION = '1.1.2';
 require XSLoader;
 XSLoader::load('Sys::Virt', $VERSION);
 
@@ -1548,7 +1548,16 @@ Remove the previously registered close callback.
 Given an array ref whose elements are XML documents describing host CPUs,
 compute the baseline CPU model that is operable across all hosts. The
 XML for the baseline CPU model is returned. The optional C<$flags>
-parameter is currently unused and defaults to 0.
+parameter can take one of
+
+=over 4
+
+=item Sys::Virt::BASELINE_CPU_EXPAND_FEATURES
+
+Expand the CPU definition to list all feature flags, even those
+implied by the model name.
+
+=back
 
 =item my $info = $con->get_node_security_model()
 
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index 3207d0b..4d7e875 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -1113,7 +1113,7 @@ or multi-card configuration. C<$st> must be a C<Sys::Virt::Stream>
 object from which the data can be read. C<$flags> is currently unused
 and defaults to 0. The mimetype of the screenshot is returned
 
-=item @vcpuinfo = $dom->get_vcpu_info()
+=item @vcpuinfo = $dom->get_vcpu_info($flags=0)
 
 Obtain information about the state of all virtual CPUs in a running
 guest domain. The returned list will have one element for each vCPU,
@@ -1124,7 +1124,9 @@ time of the vCPU, C<state> the running state and C<affinity> giving
 the allowed shedular placement. The value for C<affinity> is a
 string representing a bitmask against physical CPUs, 8 cpus per
 character. To extract the bits use the C<unpack> function with
-the C<b*> template.
+the C<b*> template. NB The C<state>, C<cpuTime>, C<cpu> values are
+only available if using C<$flags> value of 0, and the domain is
+currently running; otherwise they will all be set to zero.
 
 =item $dom->pin_vcpu($vcpu, $mask)
 
@@ -2513,7 +2515,11 @@ These constants describe the reason for a disk change event
 
 =item Sys::Virt::Domain::EVENT_DISK_CHANGE_MISSING_ON_START
 
-The disk media was missing when attempting to start the guest
+The disk media was cleared, as its source was missing when attempting to start the guest
+
+=item Sys::Virt::Domain::EVENT_DISK_DROP_MISSING_ON_START
+
+The disk device was dropped, as its source was missing whe  attempting to start the guest
 
 =back
 
diff --git a/perl-Sys-Virt.spec b/perl-Sys-Virt.spec
index 97d141d..630832f 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.1
+Version:        1.1.2
 Release:        1%{?dist}%{?extra_release}
 Summary:        Represent and manage a libvirt hypervisor connection
 License:        GPLv2+ or Artistic

-- 
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