From eae08b0d83eb9377abd6872f8603524eabd9c64c Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Aug 08 2013 10:00:46 +0000 Subject: import perl-Sys-Virt-1.1.1-2.el7.src.rpm --- diff --git a/.perl-Sys-Virt.metadata b/.perl-Sys-Virt.metadata new file mode 100644 index 0000000..5c57f00 --- /dev/null +++ b/.perl-Sys-Virt.metadata @@ -0,0 +1 @@ +4fb0c4248dca1b5b09521bf8651b9a6cff2baea2 SOURCES/Sys-Virt-1.1.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Fix-error-handling-for-virNodeDeviceGetParent.patch b/SOURCES/0001-Fix-error-handling-for-virNodeDeviceGetParent.patch new file mode 100644 index 0000000..e1b2f6d --- /dev/null +++ b/SOURCES/0001-Fix-error-handling-for-virNodeDeviceGetParent.patch @@ -0,0 +1,52 @@ +From 4eaf7009f1346e11a7d8903025d07ecee84ccf36 Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Tue, 6 Aug 2013 14:23:55 +0100 +Subject: [PATCH] Fix error handling for virNodeDeviceGetParent() + + https://bugzilla.redhat.com/show_bug.cgi?id=994141 + +It is valid for virNodeDeviceGetParent() to return NULL in the +case where there is no parent device present. + +Signed-off-by: Daniel P. Berrange +(cherry picked from commit 43666d996feed10d72a1eb03415901d7b3d5332a) +--- + Virt.xs | 6 ++++-- + examples/node-devlist.pl | 11 +++++++++++ + 2 files changed, 15 insertions(+), 2 deletions(-) + create mode 100644 examples/node-devlist.pl + +diff --git a/Virt.xs b/Virt.xs +index aa4a795..f8ebce7 100644 +--- a/Virt.xs ++++ b/Virt.xs +@@ -5390,8 +5390,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 + +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/SOURCES/0002-Fix-handling-of-flags-in-get_vcpu_info.patch b/SOURCES/0002-Fix-handling-of-flags-in-get_vcpu_info.patch new file mode 100644 index 0000000..525d355 --- /dev/null +++ b/SOURCES/0002-Fix-handling-of-flags-in-get_vcpu_info.patch @@ -0,0 +1,103 @@ +From 97dc203690393940914039824204310fd3d57473 Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Tue, 6 Aug 2013 15:46:02 +0100 +Subject: [PATCH] Fix handling of flags in get_vcpu_info() + + https://bugzilla.redhat.com/show_bug.cgi?id=994139 + +We must always use virDomainGetVcpus if flags is zero and +fall back to virDomainGetVcpuPinInfo if we get an error +indicating the guest was shutoff. + +Signed-off-by: Daniel P. Berrange +(cherry picked from commit 08613905c70525810dfc107c54f3b9ddf7e4ae7c) +--- + Virt.xs | 21 +++++++++++++++++---- + examples/vcpuinfo.pl | 4 ++-- + lib/Sys/Virt/Domain.pm | 6 ++++-- + 3 files changed, 23 insertions(+), 8 deletions(-) + +diff --git a/Virt.xs b/Virt.xs +index f8ebce7..e6b431c 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)); +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/Domain.pm b/lib/Sys/Virt/Domain.pm +index 3207d0b..dc5b9cf 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 + 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 the running state and C giving + the allowed shedular placement. The value for C is a + string representing a bitmask against physical CPUs, 8 cpus per + character. To extract the bits use the C function with +-the C template. ++the C template. NB The C, C, C 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) + diff --git a/SPECS/perl-Sys-Virt.spec b/SPECS/perl-Sys-Virt.spec new file mode 100644 index 0000000..abdd6af --- /dev/null +++ b/SPECS/perl-Sys-Virt.spec @@ -0,0 +1,253 @@ +# Automatically generated by perl-Sys-Virt.spec.PL + +Name: perl-Sys-Virt +Version: 1.1.1 +Release: 2%{?dist}%{?extra_release} +Summary: Represent and manage a libvirt hypervisor connection +License: GPLv2+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Sys-Virt/ +Source0: http://www.cpan.org/authors/id/D/DA/DANBERR/Sys-Virt-%{version}.tar.gz +Patch1: 0001-Fix-error-handling-for-virNodeDeviceGetParent.patch +Patch2: 0002-Fix-handling-of-flags-in-get_vcpu_info.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Test::Pod) +BuildRequires: perl(Test::Pod::Coverage) +BuildRequires: perl(Test::CPAN::Changes) +BuildRequires: perl(XML::XPath) +BuildRequires: perl(Time::HiRes) +BuildRequires: libvirt-devel >= %{version} +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +%description +The Sys::Virt module provides a Perl XS binding to the libvirt virtual +machine management APIs. This allows machines running within arbitrary +virtualization containers to be managed with a consistent API. + +%prep +%setup -q -n Sys-Virt-%{version} +%patch1 -p1 +%patch2 -p1 + +sed -i -e '/Sys-Virt\.spec/d' Makefile.PL +sed -i -e '/\.spec\.PL$/d' MANIFEST +rm -f *.spec.PL + +%build +%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT + +find $RPM_BUILD_ROOT -type f \( -name .packlist -o -name '*.bs' -empty \) | + xargs rm -f +find $RPM_BUILD_ROOT -depth -type d -empty -exec rmdir {} \; + +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc AUTHORS Changes LICENSE README examples/ +%{perl_vendorarch}/auto/* +%{perl_vendorarch}/Sys* +%{_mandir}/man3/* + +%changelog +* Thu Aug 8 2013 Daniel P. Berrange - 1.1.1-2 +- Fix incorrect handling of flags in $dom->get_vcpu_info() (rhbz #994139) +- Fix error handling in $dev->get_parent() (rhbz #994141) + +* Tue Jul 30 2013 Daniel P. Berrange - 1.1.1-1 +- Update to 1.1.1 release + +* Tue Jul 30 2013 Daniel P. Berrange - 1.1.0-1 +- Update to 1.1.0 release + +* Wed Jul 24 2013 Petr Pisar - 1.0.5-2 +- Perl 5.18 rebuild + +* Tue May 14 2013 Daniel P. Berrange - 1.0.5-1 +- Update to 1.0.5 release + +* Tue Mar 5 2013 Daniel P. Berrange - 1.0.3-1 +- Update to 1.0.3 release + +* Wed Feb 27 2013 Daniel P. Berrange - 1.0.2-1 +- Update to 1.0.2 release + +* Tue Feb 26 2013 Daniel P. Berrange - 1.0.1-1 +- Update to 1.0.1 release + +* Thu Feb 14 2013 Fedora Release Engineering - 1.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Nov 16 2012 Daniel P. Berrange - 1.0.0-1 +- Update to 1.0.0 release + +* Wed Sep 26 2012 Daniel P. Berrange - 0.10.2-1 +- Update to 0.10.2 release + +* Mon Sep 17 2012 Daniel P. Berrange - 0.10.0-1 +- Update to 0.10.0 release + +* Fri Jul 20 2012 Fedora Release Engineering - 0.9.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 09 2012 Petr Pisar - 0.9.13-2 +- Perl 5.16 rebuild + +* Mon Jul 2 2012 Daniel P. Berrange - 0.9.13-1 +- Update to 0.9.13 release + +* Fri Jun 15 2012 Petr Pisar - 0.9.12-2 +- Perl 5.16 rebuild + +* Mon May 21 2012 Daniel P. Berrange - 0.9.12-1 +- Update to 0.9.12 release + +* Mon Apr 16 2012 Daniel P. Berrange - 0.9.11-1 +- Update to 0.9.11 release + +* Mon Feb 13 2012 Daniel P. Berrange - 0.9.10-1 +- Update to 0.9.10 release + +* Mon Jan 9 2012 Daniel P. Berrange - 0.9.9-1 +- Update to 0.9.9 release + +* Tue Jan 3 2012 Daniel P. Berrange - 0.9.8-1 +- Update to 0.9.8 release + +* Tue Nov 8 2011 Daniel P. Berrange - 0.9.7-1 +- Update to 0.9.7 release + +* Mon Oct 17 2011 Daniel P. Berrange - 0.9.5-2 +- Add binding for virDomainOpenConsole + +* Thu Sep 29 2011 Daniel P. Berrange - 0.9.5-1 +- Update to 0.9.5 release + +* Wed Aug 3 2011 Daniel P. Berrange - 0.9.4-2 +- Re-add virDomainAbortJob API binding accidentally removed + +* Wed Aug 3 2011 Daniel P. Berrange - 0.9.4-1 +- Update to 0.9.4 release + +* Thu Jul 21 2011 Petr Sabata - 0.9.3-3 +- Perl mass rebuild + +* Tue Jul 19 2011 Petr Sabata - 0.9.3-2 +- Perl mass rebuild + +* Tue Jul 12 2011 Daniel P. Berrange - 0.9.3-1 +- Update to 0.9.3 release + +* Fri Jul 8 2011 Daniel P. Berrange - 0.9.2-1 +- Update to 0.9.2 release + +* Wed Jun 29 2011 Daniel P. Berrange - 0.2.7-1 +- Update to 0.2.7 release + +* Thu May 19 2011 Matthew Booth - 0.2.6-3 +- Backport get_xml_description with flags + +* Wed Feb 16 2011 Daniel P Berrange - 0.2.6-2 +- Workaround Test::More's inability to cast XML::XPath::Number to an int + +* Wed Feb 16 2011 Daniel P Berrange - 0.2.6-1 +- Update to 0.2.6 release + +* Wed Feb 09 2011 Fedora Release Engineering - 0.2.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Dec 22 2010 Marcela Maslanova - 0.2.4-3 +- 661697 rebuild for fixing problems with vendorach/lib + +* Sat Aug 14 2010 Daniel P. Berrange - 0.2.4-2 +- Rebuild against perl 5.12.0 +- Fix hostname test + +* Wed May 19 2010 Daniel P. Berrange - 0.2.4-1 +- Update to 0.2.4 release + +* Thu May 06 2010 Marcela Maslanova - 0.2.3-2 +- Mass rebuild with perl-5.12.0 + +* Fri Jan 15 2010 Daniel P. Berrange - 0.2.3-1 +- Update to 0.2.3 release + +* Mon Dec 7 2009 Stepan Kasal - 0.2.1-2 +- rebuild against perl 5.10.1 + +* Wed Aug 26 2009 Stepan Kasal - 0.2.1-1 +- new upstream version +- remove upstreamed patch + +* Sun Jul 26 2009 Fedora Release Engineering - 0.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Mar 30 2009 Stepan Kasal - 0.2.0-2 +- BR: libvirt >= 0.6.1 + +* Mon Mar 30 2009 Stepan Kasal - 0.2.0-1 +- new upstream version (#237421) + +* Thu Feb 26 2009 Fedora Release Engineering - 0.1.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Mar 07 2008 Daniel P. Berrange - 0.1.2-3 +- Fix calls to free() in XS binding + +* Thu Mar 06 2008 Tom "spot" Callaway - 0.1.2-2 +Rebuild for new perl + +* Wed Mar 05 2008 Steven Pritchard 0.1.2-1 +- Update to 0.1.2. +- Drop Sys-Virt-doc.patch. +- BR XML::XPath. +- No longer need to BR pkgconfig or xen-devel. +- Disable 100-connect test. + +* Tue Feb 19 2008 Fedora Release Engineering - 0.1.1-10 +- Autorebuild for GCC 4.3 + +* Tue Apr 17 2007 Steven Pritchard 0.1.1-9 +- BR ExtUtils::MakeMaker. + +* Tue Apr 17 2007 Steven Pritchard 0.1.1-8 +- Use fixperms macro instead of our own chmod incantation. + +* Mon Aug 28 2006 Steven Pritchard 0.1.1-7 +- Rebuild. + +* Sat Aug 19 2006 Steven Pritchard 0.1.1-6 +- More documentation fixes. + +* Fri Aug 18 2006 Steven Pritchard 0.1.1-5 +- Make this spec work on FC5 or FC6. +- Add ExclusiveArch to match xen and libvirt. + +* Fri Aug 18 2006 Steven Pritchard 0.1.1-4 +- BR xen-devel. + +* Fri Aug 18 2006 Steven Pritchard 0.1.1-3 +- BR Test::Pod and Test::Pod::Coverage. + +* Sat Aug 12 2006 Steven Pritchard 0.1.1-2 +- Add Sys-Virt-Domain-doc.patch. + +* Sat Aug 12 2006 Steven Pritchard 0.1.1-1 +- Specfile autogenerated by cpanspec 1.68. +- BR libvirt-devel and pkgconfig. +- Fix License. +- Drop non-doc autobuild.sh and add the examples directory. +- Don't try to build the included perl-Sys-Virt.spec.