[perl-Sys-Virt] Add binding for virDomainOpenConsole
Daniel P. Berrange
berrange at fedoraproject.org
Mon Oct 17 10:36:26 UTC 2011
commit d31f3ffd024743d38d080cda3f7b98d6d89b0d73
Author: Daniel P. Berrange <berrange at redhat.com>
Date: Mon Oct 17 11:35:47 2011 +0100
Add binding for virDomainOpenConsole
Sys-Virt-0.9.5-open-console.patch | 52 +++++++++++++++++++++++++++++++++++++
perl-Sys-Virt.spec | 7 ++++-
2 files changed, 58 insertions(+), 1 deletions(-)
---
diff --git a/Sys-Virt-0.9.5-open-console.patch b/Sys-Virt-0.9.5-open-console.patch
new file mode 100644
index 0000000..37ac788
--- /dev/null
+++ b/Sys-Virt-0.9.5-open-console.patch
@@ -0,0 +1,52 @@
+commit 2ed301207745f0750e4fc717e1eb7993431cb31b
+Author: Daniel P. Berrange <berrange at redhat.com>
+Date: Fri Oct 7 13:57:02 2011 +0100
+
+ Add missing binding for open_console
+
+diff --git a/Virt.xs b/Virt.xs
+index 673fe8b..dd54415 100644
+--- a/Virt.xs
++++ b/Virt.xs
+@@ -2199,6 +2199,21 @@ PREINIT:
+ XPUSHs(sv_2mortal(newSViv(reason)));
+
+
++void
++open_console(dom, st, devname, flags=0)
++ virDomainPtr dom;
++ virStreamPtr st;
++ SV *devname;
++ unsigned int flags;
++ PREINIT:
++ const char *devnamestr = NULL;
++ PPCODE:
++ if (SvOK(devname))
++ devnamestr = SvPV_nolen(devname);
++
++ if (virDomainOpenConsole(dom, devnamestr, st, flags) < 0) {
++ _croak_error(virGetLastError());
++ }
+
+ void
+ screenshot(dom, st, screen, flags=0)
+diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
+index 7e9c4d6..ec2dcc0 100644
+--- a/lib/Sys/Virt/Domain.pm
++++ b/lib/Sys/Virt/Domain.pm
+@@ -725,6 +725,15 @@ The C<$flags> parameter is currently unused and defaults to zero.
+ Trigger an NMI in the guest virtual machine. The C<$flags> parameter
+ is currently unused and defaults to 0.
+
++=item $dom->open_console($st, $devname, $flags)
++
++Open the text console for a serial, parallel or paravirt console
++device identified by C<$devname>, connecting it to the stream
++C<$st>. If C<$devname> is undefined, the default console will be
++opened. C<$st> must be a C<Sys::Virt::Stream> object used for
++bi-directional communication with the console. C<$flags> is
++currently unused, defaulting to 0.
++
+ =item $dom->screenshot($st, $screen, $flags)
+
+ Capture a screenshot of the virtual machine's monitor. The C<$screen>
diff --git a/perl-Sys-Virt.spec b/perl-Sys-Virt.spec
index 58e3771..56df207 100644
--- a/perl-Sys-Virt.spec
+++ b/perl-Sys-Virt.spec
@@ -1,11 +1,12 @@
Name: perl-Sys-Virt
Version: 0.9.5
-Release: 1%{?dist}
+Release: 2%{?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}-open-console.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::Pod)
@@ -21,6 +22,7 @@ virtualization containers to be managed with a consistent API.
%prep
%setup -q -n Sys-Virt-%{version}
+%patch1 -p1
sed -i -e '/Sys-Virt\.spec/d' Makefile.PL
sed -i -e '/\.spec\.PL$/d' MANIFEST
@@ -55,6 +57,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/*
%changelog
+* Mon Oct 17 2011 Daniel P. Berrange <berrange at redhat.com> - 0.9.5-2
+- Add binding for virDomainOpenConsole
+
* Thu Sep 29 2011 Daniel P. Berrange <berrange at redhat.com> - 0.9.5-1
- Update to 0.9.5 release
More information about the scm-commits
mailing list