r77434 - in /branches/upstream/libsys-virt-perl/current: CHANGES MANIFEST META.yml Makefile.PL README Virt.xs examples/send-key.pl lib/Sys/Virt.pm lib/Sys/Virt/Domain.pm lib/Sys/Virt/Event.pm perl-Sys-Virt.spec perl-Sys-Virt.spec.PL
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Thu Jul 14 08:31:00 UTC 2011
Author: carnil
Date: Thu Jul 14 08:30:49 2011
New Revision: 77434
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=77434
Log:
[svn-upgrade] new version libsys-virt-perl (0.9.3)
Added:
branches/upstream/libsys-virt-perl/current/examples/send-key.pl
Modified:
branches/upstream/libsys-virt-perl/current/CHANGES
branches/upstream/libsys-virt-perl/current/MANIFEST
branches/upstream/libsys-virt-perl/current/META.yml
branches/upstream/libsys-virt-perl/current/Makefile.PL
branches/upstream/libsys-virt-perl/current/README
branches/upstream/libsys-virt-perl/current/Virt.xs
branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm
branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Domain.pm
branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Event.pm
branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec
branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec.PL
Modified: branches/upstream/libsys-virt-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/CHANGES?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/CHANGES (original)
+++ branches/upstream/libsys-virt-perl/current/CHANGES Thu Jul 14 08:30:49 2011
@@ -1,5 +1,10 @@
Sys::Virt ChangeLog
===================
+
+New in 0.9.3:
+
+ - Add all new APIs in libvirt 0.9.3
+ - Requires libvirt >= 0.9.3
New in 0.9.2:
Modified: branches/upstream/libsys-virt-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/MANIFEST?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/MANIFEST (original)
+++ branches/upstream/libsys-virt-perl/current/MANIFEST Thu Jul 14 08:30:49 2011
@@ -5,6 +5,7 @@
examples/dump-info.pl
examples/dump-xml.pl
examples/hv-stat.pl
+examples/send-key.pl
examples/vcpuinfo.pl
examples/vol-download-all.pl
examples/vol-download-nonblock.pl
Modified: branches/upstream/libsys-virt-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/META.yml?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/META.yml (original)
+++ branches/upstream/libsys-virt-perl/current/META.yml Thu Jul 14 08:30:49 2011
@@ -1,7 +1,7 @@
--- #YAML:1.0
name: Sys-Virt
abstract: Extension for the libvirt library
-version: 0.9.2
+version: 0.9.3
author:
- Daniel P. Berrange <dan at berrange.com>
license: gpl
Modified: branches/upstream/libsys-virt-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/Makefile.PL?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/Makefile.PL (original)
+++ branches/upstream/libsys-virt-perl/current/Makefile.PL Thu Jul 14 08:30:49 2011
@@ -3,7 +3,7 @@
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-my $libvirtver = "0.9.2";
+my $libvirtver = "0.9.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;
Modified: branches/upstream/libsys-virt-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/README?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/README (original)
+++ branches/upstream/libsys-virt-perl/current/README Thu Jul 14 08:30:49 2011
@@ -7,6 +7,6 @@
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 0.9.2
+The current minimum required version of libvirt is 0.9.3
-- End
Modified: branches/upstream/libsys-virt-perl/current/Virt.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/Virt.xs?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/Virt.xs (original)
+++ branches/upstream/libsys-virt-perl/current/Virt.xs Thu Jul 14 08:30:49 2011
@@ -697,6 +697,63 @@
return success;
}
+static void
+_event_handle_helper(int watch,
+ int fd,
+ int events,
+ void *opaque)
+{
+ SV *cb = opaque;
+ dSP;
+
+ SvREFCNT_inc(cb);
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(watch)));
+ XPUSHs(sv_2mortal(newSViv(fd)));
+ XPUSHs(sv_2mortal(newSViv(events)));
+ PUTBACK;
+
+ call_sv(cb, G_DISCARD);
+
+ FREETMPS;
+ LEAVE;
+}
+
+
+static void
+_event_timeout_helper(int timer,
+ void *opaque)
+{
+ SV *cb = opaque;
+ dSP;
+
+ SvREFCNT_inc(cb);
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(timer)));
+ PUTBACK;
+
+ call_sv(cb, G_DISCARD);
+
+ FREETMPS;
+ LEAVE;
+}
+
+
+static void
+_event_cb_free(void *opaque)
+{
+ SV *data = opaque;
+ SvREFCNT_dec(data);
+}
+
static void
_stream_event_callback(virStreamPtr st,
@@ -1074,6 +1131,76 @@
}
Safefree(mem);
+
+HV *
+get_node_cpu_stats(con, cpuNum=VIR_NODE_CPU_STATS_ALL_CPUS, flags=0)
+ virConnectPtr con;
+ int cpuNum;
+ unsigned int flags;
+PREINIT:
+ virNodeCPUStatsPtr params;
+ int nparams;
+ int i;
+ CODE:
+ if (virNodeGetCPUStats(con, cpuNum, NULL, &nparams, flags) < 0) {
+ _croak_error(virGetLastError());
+ }
+
+ Newx(params, nparams, virNodeCPUStats);
+ if (virNodeGetCPUStats(con, cpuNum, params, &nparams, flags) < 0) {
+ _croak_error(virGetLastError());
+ }
+ RETVAL = (HV *)sv_2mortal((SV*)newHV());
+ for (i = 0 ; i < nparams ; i++) {
+ if (strcmp(params[i].field, VIR_NODE_CPU_STATS_KERNEL) == 0) {
+ (void)hv_store (RETVAL, "kernel", 6, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_USER) == 0) {
+ (void)hv_store (RETVAL, "user", 4, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_IDLE) == 0) {
+ (void)hv_store (RETVAL, "idle", 4, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_IOWAIT) == 0) {
+ (void)hv_store (RETVAL, "iowait", 6, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_UTILIZATION) == 0) {
+ (void)hv_store (RETVAL, "utilization", 11, virt_newSVull(params[i].value), 0);
+ }
+ }
+ Safefree(params);
+ OUTPUT:
+ RETVAL
+
+HV *
+get_node_memory_stats(con, cellNum=VIR_NODE_MEMORY_STATS_ALL_CELLS, flags=0)
+ virConnectPtr con;
+ int cellNum;
+ unsigned int flags;
+PREINIT:
+ virNodeMemoryStatsPtr params;
+ int nparams;
+ int i;
+ CODE:
+ if (virNodeGetMemoryStats(con, cellNum, NULL, &nparams, flags) < 0) {
+ _croak_error(virGetLastError());
+ }
+
+ Newx(params, nparams, virNodeMemoryStats);
+ if (virNodeGetMemoryStats(con, cellNum, params, &nparams, flags) < 0) {
+ _croak_error(virGetLastError());
+ }
+ RETVAL = (HV *)sv_2mortal((SV*)newHV());
+ for (i = 0 ; i < nparams ; i++) {
+ if (strcmp(params[i].field, VIR_NODE_MEMORY_STATS_TOTAL) == 0) {
+ (void)hv_store (RETVAL, "total", 6, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_MEMORY_STATS_FREE) == 0) {
+ (void)hv_store (RETVAL, "free", 4, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_MEMORY_STATS_BUFFERS) == 0) {
+ (void)hv_store (RETVAL, "buffers", 4, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_MEMORY_STATS_CACHED) == 0) {
+ (void)hv_store (RETVAL, "cached", 6, virt_newSVull(params[i].value), 0);
+ }
+ }
+ Safefree(params);
+ OUTPUT:
+ RETVAL
char *
find_storage_pool_sources(con, type, srcspec, flags=0)
@@ -1937,6 +2064,24 @@
OUTPUT:
RETVAL
+
+HV *
+get_control_info(dom, flags=0)
+ virDomainPtr dom;
+ unsigned int flags;
+ PREINIT:
+ virDomainControlInfo info;
+ CODE:
+ if (virDomainGetControlInfo(dom, &info, flags) < 0) {
+ _croak_error(virGetLastError());
+ }
+ RETVAL = (HV *)sv_2mortal((SV*)newHV());
+ (void)hv_store (RETVAL, "state", 5, newSViv(info.state), 0);
+ (void)hv_store (RETVAL, "details", 7, newSViv(info.details), 0);
+ (void)hv_store (RETVAL, "stateTime", 9, virt_newSVull(info.stateTime), 0);
+ OUTPUT:
+ RETVAL
+
void
get_state(dom, flags=0)
virDomainPtr dom;
@@ -2832,12 +2977,47 @@
case VIR_DOMAIN_MEMORY_STAT_AVAILABLE:
(void)hv_store (RETVAL, "available", 9, virt_newSVll(stats[i].val), 0);
break;
+
+ case VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON:
+ (void)hv_store (RETVAL, "actual_balloon", 14, virt_newSVll(stats[i].val), 0);
+ break;
}
}
Safefree(stats);
OUTPUT:
RETVAL
+
+void
+send_key(dom, codeset, holdtime, keycodesSV, flags=0)
+ virDomainPtr dom;
+ unsigned int codeset;
+ unsigned int holdtime;
+ SV *keycodesSV;
+ unsigned int flags;
+PREINIT:
+ AV *keycodesAV;
+ unsigned int *keycodes;
+ int nkeycodes;
+ int i;
+ PPCODE:
+ if (!SvROK(keycodesSV))
+ return;
+ keycodesAV = (AV*)SvRV(keycodesSV);
+ nkeycodes = av_len(keycodesAV) + 1;
+ Newx(keycodes, nkeycodes, unsigned int);
+
+ for (i = 0 ; i < nkeycodes ; i++) {
+ SV **code = av_fetch(keycodesAV, i, 0);
+ keycodes[i] = SvIV(*code);
+ }
+
+ if (virDomainSendKey(dom, codeset, holdtime, keycodes, nkeycodes, flags) < 0) {
+ Safefree(keycodes);
+ _croak_error(virGetLastError());
+ }
+
+ Safefree(keycodes);
SV *
block_peek(dom, path, offset, size, flags=0)
@@ -2897,8 +3077,9 @@
void
-get_vcpu_info(dom)
- virDomainPtr dom;
+get_vcpu_info(dom, flags=0)
+ virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virVcpuInfoPtr info;
unsigned char *cpumaps;
@@ -2915,42 +3096,60 @@
_croak_error(virGetLastError());
}
- Newx(info, dominfo.nrVirtCpu, virVcpuInfo);
maplen = VIR_CPU_MAPLEN(VIR_NODEINFO_MAXCPUS(nodeinfo));
Newx(cpumaps, dominfo.nrVirtCpu * maplen, unsigned char);
- if ((nvCpus = virDomainGetVcpus(dom, info, dominfo.nrVirtCpu, cpumaps, maplen)) < 0) {
- Safefree(info);
- Safefree(cpumaps);
- _croak_error(virGetLastError());
+ if (flags && (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
+ Newx(info, dominfo.nrVirtCpu, virVcpuInfo);
+ if ((nvCpus = virDomainGetVcpus(dom, info, dominfo.nrVirtCpu, cpumaps, maplen)) < 0) {
+ Safefree(info);
+ Safefree(cpumaps);
+ _croak_error(virGetLastError());
+ }
+ } else {
+ info = NULL;
+ if ((nvCpus = virDomainGetVcpuPinInfo(dom, dominfo.nrVirtCpu, cpumaps, maplen, flags)) < 0) {
+ Safefree(cpumaps);
+ _croak_error(virGetLastError());
+ }
}
EXTEND(SP, nvCpus);
for (i = 0 ; i < nvCpus ; i++) {
HV *rec = newHV();
- (void)hv_store(rec, "number", 6, newSViv(info[i].number), 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);
+ (void)hv_store(rec, "number", 6, newSViv(i), 0);
+ if (info) {
+ (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);
+ }
(void)hv_store(rec, "affinity", 8, newSVpvn((char*)cpumaps + (i *maplen), maplen), 0);
PUSHs(newRV_noinc((SV *)rec));
}
- Safefree(info);
+ if (info)
+ Safefree(info);
Safefree(cpumaps);
void
-pin_vcpu(dom, vcpu, mask)
+pin_vcpu(dom, vcpu, mask, flags=0)
virDomainPtr dom;
unsigned int vcpu;
SV *mask;
+ unsigned int flags;
PREINIT:
STRLEN masklen;
unsigned char *maps;
PPCODE:
maps = (unsigned char *)SvPV(mask, masklen);
- if (virDomainPinVcpu(dom, vcpu, maps, masklen) < 0) {
- _croak_error(virGetLastError());
+ if (flags) {
+ if (virDomainPinVcpuFlags(dom, vcpu, maps, masklen, flags) < 0) {
+ _croak_error(virGetLastError());
+ }
+ } else {
+ if (virDomainPinVcpu(dom, vcpu, maps, masklen) < 0) {
+ _croak_error(virGetLastError());
+ }
}
@@ -4371,6 +4570,74 @@
run_default()
PPCODE:
virEventRunDefaultImpl();
+
+
+int
+add_handle(fd, events, coderef)
+ int fd;
+ int events;
+ SV *coderef;
+PREINIT:
+ int watch;
+ CODE:
+ SvREFCNT_inc(coderef);
+
+ if ((watch = virEventAddHandle(fd, events, _event_handle_helper, coderef, _event_cb_free)) < 0) {
+ SvREFCNT_dec(coderef);
+ _croak_error(virGetLastError());
+ }
+ RETVAL = watch;
+ OUTPUT:
+ RETVAL
+
+void
+update_handle(watch, events)
+ int watch;
+ int events;
+ PPCODE:
+ virEventUpdateHandle(watch, events);
+
+void
+remove_handle(watch)
+ int watch;
+ PPCODE:
+ if (virEventRemoveHandle(watch) < 0) {
+ _croak_error(virGetLastError());
+ }
+
+
+int
+add_timeout(frequency, coderef)
+ int frequency;
+ SV *coderef;
+PREINIT:
+ int timer;
+ CODE:
+ SvREFCNT_inc(coderef);
+
+ if ((timer = virEventAddTimeout(frequency, _event_timeout_helper, coderef, _event_cb_free)) < 0) {
+ SvREFCNT_dec(coderef);
+ _croak_error(virGetLastError());
+ }
+ RETVAL = timer;
+ OUTPUT:
+ RETVAL
+
+void
+update_timeout(timer, frequency)
+ int timer;
+ int frequency;
+ PPCODE:
+ virEventUpdateTimeout(timer, frequency);
+
+void
+remove_timeout(timer)
+ int timer;
+ PPCODE:
+ if (virEventRemoveTimeout(timer) < 0) {
+ _croak_error(virGetLastError());
+ }
+
void
_run_handle_callback_helper(watch, fd, event, cbref, opaqueref)
@@ -4650,6 +4917,7 @@
REGISTER_CONSTANT(VIR_DOMAIN_CRASHED, STATE_CRASHED);
REGISTER_CONSTANT(VIR_DOMAIN_START_PAUSED, START_PAUSED);
+ REGISTER_CONSTANT(VIR_DOMAIN_START_AUTODESTROY, START_AUTODESTROY);
REGISTER_CONSTANT(VIR_DOMAIN_NOSTATE_UNKNOWN, STATE_NOSTATE_UNKNOWN);
@@ -4710,6 +4978,13 @@
REGISTER_CONSTANT(VIR_VCPU_BLOCKED, VCPU_BLOCKED);
+ REGISTER_CONSTANT(VIR_KEYCODE_SET_LINUX, KEYCODE_SET_LINUX);
+ REGISTER_CONSTANT(VIR_KEYCODE_SET_LINUX, KEYCODE_SET_XT);
+ REGISTER_CONSTANT(VIR_KEYCODE_SET_ATSET1, KEYCODE_SET_ATSET1);
+ REGISTER_CONSTANT(VIR_KEYCODE_SET_ATSET2, KEYCODE_SET_ATSET2);
+ REGISTER_CONSTANT(VIR_KEYCODE_SET_ATSET3, KEYCODE_SET_ATSET3);
+
+
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_DEFINED, EVENT_DEFINED);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_UNDEFINED, EVENT_UNDEFINED);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STARTED, EVENT_STARTED);
@@ -4738,6 +5013,12 @@
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STOPPED_MIGRATED, EVENT_STOPPED_MIGRATED);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STOPPED_SAVED, EVENT_STOPPED_SAVED);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STOPPED_FAILED, EVENT_STOPPED_FAILED);
+
+
+ REGISTER_CONSTANT(VIR_DOMAIN_CONTROL_OK, CONTROL_OK);
+ REGISTER_CONSTANT(VIR_DOMAIN_CONTROL_JOB, CONTROL_JOB);
+ REGISTER_CONSTANT(VIR_DOMAIN_CONTROL_OCCUPIED, CONTROL_OCCUPIED);
+ REGISTER_CONSTANT(VIR_DOMAIN_CONTROL_ERROR, CONTROL_ERROR);
REGISTER_CONSTANT(VIR_DOMAIN_DEVICE_MODIFY_CURRENT, DEVICE_MODIFY_CURRENT);
Added: branches/upstream/libsys-virt-perl/current/examples/send-key.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/examples/send-key.pl?rev=77434&op=file
==============================================================================
--- branches/upstream/libsys-virt-perl/current/examples/send-key.pl (added)
+++ branches/upstream/libsys-virt-perl/current/examples/send-key.pl Thu Jul 14 08:30:49 2011
@@ -1,0 +1,25 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use Sys::Virt;
+
+die "syntax: $0 URI DOMAIN-NAME\n" unless int(@ARGV) == 2;
+
+my $uri = shift @ARGV;
+my $domname = shift @ARGV;
+
+print "Addr $uri\n";
+my $con = Sys::Virt->new(address => $uri, readonly => 0);
+
+my $dom = $con->get_domain_by_name($domname);
+
+my @codes = (
+ 35, 18, 38, 38, 24,
+ 57,
+ 17, 24, 19, 38, 32,
+ 28,
+ );
+
+$dom->send_key(Sys::Virt::Domain::KEYCODE_SET_LINUX,
+ 100,
+ \@codes);
Modified: branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm (original)
+++ branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm Thu Jul 14 08:30:49 2011
@@ -71,7 +71,7 @@
use Sys::Virt::DomainSnapshot;
use Sys::Virt::Stream;
-our $VERSION = '0.9.2';
+our $VERSION = '0.9.3';
require XSLoader;
XSLoader::load('Sys::Virt', $VERSION);
@@ -1149,6 +1149,70 @@
Returns a hash reference summarising the capabilities of the host
node. The elements of the hash are as follows:
+=item my $info = $con->get_node_cpu_stats($cpuNum=-1, $flags=0)
+
+Returns a hash reference providing information about the host
+CPU statistics. If <$cpuNum> is omitted, it defaults to -1
+which causes it to return cummulative information for all
+CPUs in the host. If C<$cpuNum> is zero or larger, it returns
+information just for the specified number. The C<$flags>
+parameter is currently unused and defaults to zero. The
+fields in the returned hash reference are
+
+=over 4
+
+=item kernel
+
+The time spent in kernelspace
+
+=item user
+
+The time spent in userspace
+
+=item idle
+
+The idle time
+
+=item iowait
+
+The I/O wait time
+
+=item utilization
+
+The overall percentage utilization.
+
+=back
+
+=item my $info = $con->get_node_memory_stats($cellNum=-1, $flags=0)
+
+Returns a hash reference providing information about the host
+memory statistics. If <$cellNum> is omitted, it defaults to -1
+which causes it to return cummulative information for all
+NUMA cells in the host. If C<$cellNum> is zero or larger, it
+returns information just for the specified number. The C<$flags>
+parameter is currently unused and defaults to zero. The
+fields in the returned hash reference are
+
+=over 4
+
+=item total
+
+The total memory
+
+=item free
+
+The free memory
+
+=item buffers
+
+The memory consumed by buffers
+
+=item cache
+
+The memory consumed for cache
+
+=back
+
=item $conn->domain_event_register($callback)
Register a callback to received notificaitons of domain state change
Modified: branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Domain.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Domain.pm?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Domain.pm (original)
+++ branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Domain.pm Thu Jul 14 08:30:49 2011
@@ -336,6 +336,41 @@
=back
+=item my $info = $dom->get_control_info($flags=0)
+
+Returns a hash reference providing information about
+the control channel. The returned keys in the hash
+are
+
+=over 4
+
+=item C<state>
+
+One of the CONTROL INFO constants listed later
+
+=item C<details>
+
+Currently unsed, always 0.
+
+=item C<stateTime>
+
+The elapsed time since the control channel entered
+the current state.
+
+=back
+
+=item $dom->send_key($keycodeset, $holdtime, \@keycodes, $flags=0)
+
+Sends a sequence of keycodes to the guest domain. The
+C<$keycodeset> should be one of the constants listed
+later in the KEYCODE SET section. C<$holdtiem> is the
+duration, in milliseconds, to keep the key pressed
+before releasing it and sending the next keycode.
+C<@keycodes> is an array reference containing the list
+of keycodes to send to the guest. The elements in the
+array should be keycode values from the specified
+keycode set. C<$flags> is currently unused.
+
=item my $info = $dom->get_block_info($dev, $flags=0)
Returns a hash reference summarising the disk usage of
@@ -865,6 +900,31 @@
=back
+=head2 CONTROL INFO
+
+The following constants can be used to determine what the
+guest domain control channel status is
+
+=over 4
+
+=item Sys::Virt::Domain::CONTROL_ERROR
+
+The control channel has a fatal error
+
+=item Sys::Virt::Domain::CONTROL_OK
+
+The control channel is ready for jobs
+
+=item Sys::Virt::Domain::CONTROL_OCCUPIED
+
+The control channel is busy
+
+=item Sys::Virt::Domain::CONTROL_JOB
+
+The control channel is busy with a job
+
+=back
+
=head2 DOMAIN CREATION
The following constants can be used to control the behaviour
@@ -876,8 +936,41 @@
Keep the guest vCPUs paused after starting the guest
-=back
-
+=item Sys::Virt::Domain::START_AUTODESTROY
+
+Automatically destroy the guest when the connection is closed (or fails)
+
+=back
+
+
+=head2 KEYCODE SETS
+
+The following constants define the set of supported keycode
+sets
+
+=over 4
+
+=item Sys::Virt::Domain::KEYCODE_SET_LINUX
+
+The Linux event subsystem keycodes
+
+=item Sys::Virt::Domain::KEYCODE_SET_XT
+
+The original XT keycodes
+
+=item Sys::Virt::Domain::KEYCODE_SET_ATSET1
+
+The AT Set1 keycodes (aka XT)
+
+=item Sys::Virt::Domain::KEYCODE_SET_ATSET2
+
+The AT Set2 keycodes (aka AT)
+
+=item Sys::Virt::Domain::KEYCODE_SET_ATSET3
+
+The AT Set3 keycodes (aka PS2)
+
+=back
=head2 MEMORY PEEK
Modified: branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Event.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Event.pm?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Event.pm (original)
+++ branches/upstream/libsys-virt-perl/current/lib/Sys/Virt/Event.pm Thu Jul 14 08:30:49 2011
@@ -146,6 +146,42 @@
1;
+=item my $watch = Sys::Virt::Event::add_handle($fd, $events, $coderef)
+
+Adds a watch on the file descriptor C<$fd> for the events C<$events>
+which is a mask of the FILE HANDLE EVENTS constants listed later.
+The C<$coderef> parameter is a subroutine to invoke when an event
+is triggered. The subroutine will be passed three parameters, the
+watch identifier, the file descriptor and the event mask. This
+method returns the watch identifier which can be used to update or
+remove the watch
+
+=item Sys::Virt::Event::update_handle($watch, $events)
+
+Update the event mask for the file descriptor watch C<$watch>
+to use the events C<$events>.
+
+=item Sys::Virt::Event::remove_handle($watch)
+
+Remove the event mask for the file descriptor watch C<$watch>.
+
+=item my $watch = Sys::Virt::Event::add_timeout($frequency, $coderef)
+
+Adds a timeout to trigger with C<$frequency> milliseconds interval.
+The C<$coderef> parameter is a subroutine to invoke when an event
+is triggered. The subroutine will be passed one parameter, the
+timer identifier. This method returns the watch identifier which
+can be used to update or remove the watch
+
+=item Sys::Virt::Event::update_timeout($timer, $frequency)
+
+Update the timeout C<$timer> to have the frequency C<$frequency>
+milliseconds.
+
+=item Sys::Virt::Event::remove_timeout($timer)
+
+Remove the timeout C<$timer>
+
=back
=head1 CONSTANTS
Modified: branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec (original)
+++ branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec Thu Jul 14 08:30:49 2011
@@ -1,7 +1,7 @@
# Automatically generated by perl-Sys-Virt.spec.PL
Name: perl-Sys-Virt
-Version: 0.9.2
+Version: 0.9.3
Release: 1%{?dist}%{?extra_release}
Summary: Represent and manage a libvirt hypervisor connection
License: GPLv2+ or Artistic
@@ -13,7 +13,7 @@
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(XML::XPath)
-BuildRequires: libvirt-devel >= 0.9.2
+BuildRequires: libvirt-devel >= 0.9.3
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description
Modified: branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec.PL?rev=77434&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec.PL (original)
+++ branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec.PL Thu Jul 14 08:30:49 2011
@@ -35,7 +35,7 @@
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(XML::XPath)
-BuildRequires: libvirt-devel >= 0.9.2
+BuildRequires: libvirt-devel >= 0.9.3
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description
More information about the Pkg-perl-cvs-commits
mailing list