[perl-Sys-Virt/f14] Backport get_xml_description(flags) and connect test failure

Daniel P. Berrange berrange at fedoraproject.org
Thu May 19 10:12:47 UTC 2011


commit 8c6798371201212dd86953797c4939e4efaf7823
Author: Matthew Booth <mbooth at redhat.com>
Date:   Thu May 19 10:44:43 2011 +0100

    Backport get_xml_description(flags) and connect test failure

 Sys-Virt-0.2.4-get_xml_description-flags.patch |  140 ++++++++++++++++++++++++
 Sys-Virt-0.2.4-xpath-cast.patch                |   22 ++++
 perl-Sys-Virt.spec                             |   10 ++-
 3 files changed, 171 insertions(+), 1 deletions(-)
---
diff --git a/Sys-Virt-0.2.4-get_xml_description-flags.patch b/Sys-Virt-0.2.4-get_xml_description-flags.patch
new file mode 100644
index 0000000..60dd0b7
--- /dev/null
+++ b/Sys-Virt-0.2.4-get_xml_description-flags.patch
@@ -0,0 +1,140 @@
+commit 1584802db490cd459c07040cc636fd6f1ec35804
+Author: Daniel P. Berrange <berrange at redhat.com>
+Date:   Wed May 18 15:20:26 2011 +0100
+
+    Honour the flags parameter in all XML getters
+    
+    * Virt.xs: Add flags parameter to all get_xml_description methods
+
+diff --git a/Virt.xs b/Virt.xs
+index 3e42bf2..129d2f3 100644
+--- a/Virt.xs
++++ b/Virt.xs
+@@ -2162,12 +2162,13 @@ get_os_type(dom)
+       RETVAL
+ 
+ SV *
+-get_xml_description(dom)
++get_xml_description(dom, flags=0)
+       virDomainPtr dom;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virDomainGetXMLDesc(dom, 0))) {
++      if (!(xml = virDomainGetXMLDesc(dom, flags))) {
+ 	 _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -2738,12 +2739,13 @@ get_bridge_name(net)
+       RETVAL
+ 
+ SV *
+-get_xml_description(net)
++get_xml_description(net, flags=0)
+       virNetworkPtr net;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virNetworkGetXMLDesc(net, 0))) {
++      if (!(xml = virNetworkGetXMLDesc(net, flags))) {
+ 	 _croak_error(virConnGetLastError(virNetworkGetConnect(net)));
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -2945,12 +2947,13 @@ is_persistent(pool)
+ 
+ 
+ SV *
+-get_xml_description(pool)
++get_xml_description(pool, flags=0)
+       virStoragePoolPtr pool;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virStoragePoolGetXMLDesc(pool, 0))) {
++      if (!(xml = virStoragePoolGetXMLDesc(pool, flags))) {
+ 	 _croak_error(virConnGetLastError(virStoragePoolGetConnect(pool)));
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -3192,12 +3195,13 @@ get_path(vol)
+ 
+ 
+ SV *
+-get_xml_description(vol)
++get_xml_description(vol, flags=0)
+       virStorageVolPtr vol;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virStorageVolGetXMLDesc(vol, 0))) {
++      if (!(xml = virStorageVolGetXMLDesc(vol, flags))) {
+ 	 _croak_error(virConnGetLastError(virStorageVolGetConnect(vol)));
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -3302,12 +3306,13 @@ get_parent(dev)
+ 
+ 
+ SV *
+-get_xml_description(dev)
++get_xml_description(dev, flags=0)
+       virNodeDevicePtr dev;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virNodeDeviceGetXMLDesc(dev, 0))) {
++      if (!(xml = virNodeDeviceGetXMLDesc(dev, flags))) {
+ 	_croak_error(virGetLastError());
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -3457,12 +3462,13 @@ is_active(iface)
+ 
+ 
+ SV *
+-get_xml_description(iface)
++get_xml_description(iface, flags=0)
+       virInterfacePtr iface;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virInterfaceGetXMLDesc(iface, 0))) {
++      if (!(xml = virInterfaceGetXMLDesc(iface, flags))) {
+ 	 _croak_error(virConnGetLastError(virInterfaceGetConnect(iface)));
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -3610,12 +3616,13 @@ get_usage_type(sec)
+ 
+ 
+ SV *
+-get_xml_description(sec)
++get_xml_description(sec, flags=0)
+       virSecretPtr sec;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virSecretGetXMLDesc(sec, 0))) {
++      if (!(xml = virSecretGetXMLDesc(sec, flags))) {
+ 	 _croak_error(virConnGetLastError(virSecretGetConnect(sec)));
+       }
+       RETVAL = newSVpv(xml, 0);
+@@ -3761,12 +3768,13 @@ get_name(filter)
+ 
+ 
+ SV *
+-get_xml_description(filter)
++get_xml_description(filter, flags=0)
+       virNWFilterPtr filter;
++      unsigned int flags;
+   PREINIT:
+       char *xml;
+     CODE:
+-      if (!(xml = virNWFilterGetXMLDesc(filter, 0))) {
++      if (!(xml = virNWFilterGetXMLDesc(filter, flags))) {
+ 	_croak_error(virGetLastError());
+       }
+       RETVAL = newSVpv(xml, 0);
diff --git a/Sys-Virt-0.2.4-xpath-cast.patch b/Sys-Virt-0.2.4-xpath-cast.patch
new file mode 100644
index 0000000..44cde19
--- /dev/null
+++ b/Sys-Virt-0.2.4-xpath-cast.patch
@@ -0,0 +1,22 @@
+commit 051dd561018db58a265ac4063de0a16b0cf48006
+Author: Daniel P. Berrange <dan at berrange.com>
+Date:   Wed Feb 16 22:11:52 2011 +0000
+
+    Workaround problems with casting XML::XPath::Number to int
+
+diff --git a/t/100-connect.t b/t/100-connect.t
+index 3cf7634..98183b7 100644
+--- a/t/100-connect.t
++++ b/t/100-connect.t
+@@ -46,9 +46,9 @@ my $guestword = $xp->find("string(/capabilities/guest[1]/arch/wordsize)");
+ is($guestword, "32", "wordsize");
+ my $guesttype = $xp->find("string(/capabilities/guest[1]/arch/domain/\@type)");
+ is($guesttype, "test", "type");
+-my $guestpae = $xp->find("count(/capabilities/guest[1]/features/pae)");
++my $guestpae = int($xp->find("count(/capabilities/guest[1]/features/pae)"));
+ is($guestpae,  1, "pae");
+-my $guestnonpae = $xp->find("count(/capabilities/guest[1]/features/nonpae)");
++my $guestnonpae = int($xp->find("count(/capabilities/guest[1]/features/nonpae)"));
+ is($guestnonpae, 1, "nonpae");
+ 
+ my $ver = $conn->get_version();
diff --git a/perl-Sys-Virt.spec b/perl-Sys-Virt.spec
index 987bb7e..804f79e 100644
--- a/perl-Sys-Virt.spec
+++ b/perl-Sys-Virt.spec
@@ -1,12 +1,14 @@
 Name:           perl-Sys-Virt
 Version:        0.2.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 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:         Sys-Virt-%{version}-hostname.patch
+Patch2:         Sys-Virt-%{version}-get_xml_description-flags.patch
+Patch3:         Sys-Virt-%{version}-xpath-cast.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  perl(ExtUtils::MakeMaker)
 BuildRequires:  perl(Test::Pod)
@@ -23,6 +25,8 @@ virtualization containers to be managed with a consistent API.
 %prep
 %setup -q -n Sys-Virt-%{version}
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 sed -i -e '/Sys-Virt\.spec/d' Makefile.PL
 sed -i -e '/\.spec\.PL$/d' MANIFEST
@@ -57,6 +61,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man3/*
 
 %changelog
+* Thu May 19 2011 Matthew Booth <mbooth at redhat.com> - 0.2.4-3
+- Backport get_xml_description with flags
+- Backport fix for connect test failure
+
 * Sat Aug 14 2010 Daniel P. Berrange <berrange at redhat.com> - 0.2.4-2
 - Rebuild against perl 5.12.0
 - Fix hostname test


More information about the scm-commits mailing list