Hello community, here is the log from the commit of package perl-Sys-Virt for openSUSE:Factory checked in at 2012-06-05 15:34:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Sys-Virt (Old) and /work/SRC/openSUSE:Factory/.perl-Sys-Virt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Sys-Virt", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Sys-Virt/perl-Sys-Virt.changes 2012-02-17 12:08:14.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Sys-Virt.new/perl-Sys-Virt.changes 2012-06-05 15:34:13.000000000 +0200 @@ -1,0 +2,10 @@ +Thu May 31 10:16:59 MDT 2012 - [email protected] + +- Update to 0.9.11 + - Add all new APIs in libvirt 0.9.11 + - Add test case to validate API coverage + - Fix misc POD docs bugs + - Fix reference handling in block stats + - Add handling of VIR_TYPED_PARAM_STRING + +------------------------------------------------------------------- Old: ---- Sys-Virt-0.9.10.tar.gz New: ---- Sys-Virt-0.9.11.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Sys-Virt.spec ++++++ --- /var/tmp/diff_new_pack.VLY0nf/_old 2012-06-05 15:34:16.000000000 +0200 +++ /var/tmp/diff_new_pack.VLY0nf/_new 2012-06-05 15:34:16.000000000 +0200 @@ -16,9 +16,8 @@ # - Name: perl-Sys-Virt -Version: 0.9.10 +Version: 0.9.11 Release: 0 %define cpan_name Sys-Virt Summary: Represent and manage a libvirt hypervisor connection @@ -31,9 +30,9 @@ BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Test::Pod) BuildRequires: perl(Test::Pod::Coverage) +BuildRequires: perl(Time::HiRes) BuildRequires: perl(XML::XPath) BuildRequires: perl(XML::XPath::XMLParser) -BuildRequires: perl(Time::HiRes) BuildRoot: %{_tmppath}/%{name}-%{version}-build %{perl_requires} ++++++ Sys-Virt-0.9.10.tar.gz -> Sys-Virt-0.9.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/Changes new/Sys-Virt-0.9.11/Changes --- old/Sys-Virt-0.9.10/Changes 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/Changes 2012-04-16 12:24:52.000000000 +0200 @@ -1,5 +1,13 @@ Revision history for perl module Sys::Virt +0.9.11 2012-04-16 + + - Add all new APIs in libvirt 0.9.11 + - Add test case to validate API coverage + - Fix misc POD docs bugs + - Fix reference handling in block stats + - Add handling of VIR_TYPED_PARAM_STRING + 0.9.10 2012-02-12 - Add all new APIs in libvirt 0.9.10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/MANIFEST new/Sys-Virt-0.9.11/MANIFEST --- old/Sys-Virt-0.9.10/MANIFEST 2012-02-13 18:51:50.000000000 +0100 +++ new/Sys-Virt-0.9.11/MANIFEST 2012-04-16 12:25:09.000000000 +0200 @@ -45,6 +45,7 @@ t/010-pod-coverage.t t/015-changes.t t/020-constants.t +t/030-api-coverage.t t/100-connect.t t/200-domains.t t/300-networks.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/META.yml new/Sys-Virt-0.9.11/META.yml --- old/Sys-Virt-0.9.10/META.yml 2012-02-13 18:51:50.000000000 +0100 +++ new/Sys-Virt-0.9.11/META.yml 2012-04-16 12:25:08.000000000 +0200 @@ -1,7 +1,7 @@ --- #YAML:1.0 name: Sys-Virt abstract: Extension for the libvirt library -version: 0.9.10 +version: 0.9.11 author: - Daniel P. Berrange <[email protected]> license: perl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/MYMETA.yml new/Sys-Virt-0.9.11/MYMETA.yml --- old/Sys-Virt-0.9.10/MYMETA.yml 2012-02-13 18:51:41.000000000 +0100 +++ new/Sys-Virt-0.9.11/MYMETA.yml 2012-04-16 12:24:58.000000000 +0200 @@ -25,4 +25,4 @@ Test::Pod::Coverage: 0 Time::HiRes: 0 XML::XPath: 0 -version: 0.9.10 +version: 0.9.11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/Makefile.PL new/Sys-Virt-0.9.11/Makefile.PL --- old/Sys-Virt-0.9.10/Makefile.PL 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/Makefile.PL 2012-04-16 12:24:52.000000000 +0200 @@ -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.10"; +my $libvirtver = "0.9.11"; 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/README new/Sys-Virt-0.9.11/README --- old/Sys-Virt-0.9.10/README 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/README 2012-04-16 12:24:52.000000000 +0200 @@ -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.10 +The current minimum required version of libvirt is 0.9.11 -- End diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/Virt.xs new/Sys-Virt-0.9.11/Virt.xs --- old/Sys-Virt-0.9.10/Virt.xs 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/Virt.xs 2012-04-16 12:24:52.000000000 +0200 @@ -396,6 +396,122 @@ static int +_domain_event_tray_change_callback(virConnectPtr con, + virDomainPtr dom, + const char *devAlias, + int reason, + void *opaque) +{ + AV *data = opaque; + SV **self; + SV **cb; + SV *domref; + dSP; + + self = av_fetch(data, 0, 0); + cb = av_fetch(data, 1, 0); + + SvREFCNT_inc(*self); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(*self); + domref = sv_newmortal(); + sv_setref_pv(domref, "Sys::Virt::Domain", (void*)dom); + virDomainRef(dom); + XPUSHs(domref); + XPUSHs(sv_2mortal(newSVpv(devAlias, 0))); + XPUSHs(sv_2mortal(newSViv(reason))); + PUTBACK; + + call_sv(*cb, G_DISCARD); + + FREETMPS; + LEAVE; + + return 0; +} + + +static int +_domain_event_pmwakeup_callback(virConnectPtr con, + virDomainPtr dom, + int reason, + void *opaque) +{ + AV *data = opaque; + SV **self; + SV **cb; + SV *domref; + dSP; + + self = av_fetch(data, 0, 0); + cb = av_fetch(data, 1, 0); + + SvREFCNT_inc(*self); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(*self); + domref = sv_newmortal(); + sv_setref_pv(domref, "Sys::Virt::Domain", (void*)dom); + virDomainRef(dom); + XPUSHs(domref); + XPUSHs(sv_2mortal(newSViv(reason))); + PUTBACK; + + call_sv(*cb, G_DISCARD); + + FREETMPS; + LEAVE; + + return 0; +} + + +static int +_domain_event_pmsuspend_callback(virConnectPtr con, + virDomainPtr dom, + int reason, + void *opaque) +{ + AV *data = opaque; + SV **self; + SV **cb; + SV *domref; + dSP; + + self = av_fetch(data, 0, 0); + cb = av_fetch(data, 1, 0); + + SvREFCNT_inc(*self); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(*self); + domref = sv_newmortal(); + sv_setref_pv(domref, "Sys::Virt::Domain", (void*)dom); + virDomainRef(dom); + XPUSHs(domref); + XPUSHs(sv_2mortal(newSViv(reason))); + PUTBACK; + + call_sv(*cb, G_DISCARD); + + FREETMPS; + LEAVE; + + return 0; +} + + +static int _domain_event_io_error_reason_callback(virConnectPtr con, virDomainPtr dom, const char *srcPath, @@ -1011,6 +1127,7 @@ HV *ret = (HV *)sv_2mortal((SV*)newHV()); unsigned int i; const char *field; + STRLEN val_length; for (i = 0 ; i < nparams ; i++) { SV *val = NULL; @@ -1039,6 +1156,12 @@ case VIR_TYPED_PARAM_BOOLEAN: val = newSViv(params[i].value.b); break; + + case VIR_TYPED_PARAM_STRING: + val_length = strlen(params[i].value.s); + val = newSVpv(params[i].value.s, val_length); + break; + } field = params[i].field; @@ -1049,10 +1172,14 @@ } -static void +static int vir_typed_param_from_hv(HV *newparams, virTypedParameter *params, int nparams) { unsigned int i; + char * ptr; + STRLEN len; + int needString = 0; + for (i = 0 ; i < nparams ; i++) { SV **val; @@ -1085,8 +1212,15 @@ case VIR_TYPED_PARAM_BOOLEAN: params[i].value.b = SvIV(*val); break; + + case VIR_TYPED_PARAM_STRING: + needString = 1; + ptr = SvPV(*val, len); + params[i].value.s = (char *)ptr; + break; } } + return needString; } @@ -2031,6 +2165,15 @@ case VIR_DOMAIN_EVENT_ID_DISK_CHANGE: callback = VIR_DOMAIN_EVENT_CALLBACK(_domain_event_disk_change_callback); break; + case VIR_DOMAIN_EVENT_ID_TRAY_CHANGE: + callback = VIR_DOMAIN_EVENT_CALLBACK(_domain_event_tray_change_callback); + break; + case VIR_DOMAIN_EVENT_ID_PMSUSPEND: + callback = VIR_DOMAIN_EVENT_CALLBACK(_domain_event_pmsuspend_callback); + break; + case VIR_DOMAIN_EVENT_ID_PMWAKEUP: + callback = VIR_DOMAIN_EVENT_CALLBACK(_domain_event_pmwakeup_callback); + break; default: callback = VIR_DOMAIN_EVENT_CALLBACK(_domain_event_generic_callback); break; @@ -2307,6 +2450,15 @@ void +pm_wakeup(dom, flags) + virDomainPtr dom; + unsigned int flags; + PPCODE: + if ((virDomainPMWakeup(dom, flags)) < 0) + _croak_error(); + + +void save(dom, to, dxmlsv=&PL_sv_undef, flags=0) virDomainPtr dom; const char *to; @@ -2799,8 +2951,9 @@ virDomainPtr dom; HV *newparams; PREINIT: - virBlkioParameter *params; + virTypedParameter *params; int nparams; + int needString; PPCODE: nparams = 0; if (virDomainGetBlkioParameters(dom, NULL, &nparams, 0) < 0) @@ -2813,9 +2966,10 @@ _croak_error(); } - vir_typed_param_from_hv(newparams, params, nparams); + needString = vir_typed_param_from_hv(newparams, params, nparams); - if (virDomainSetBlkioParameters(dom, params, nparams, 0) < 0) + if (virDomainSetBlkioParameters(dom, params, nparams, + needString ? VIR_TYPED_PARAM_STRING_OKAY: 0) < 0) _croak_error(); Safefree(params); @@ -3358,6 +3512,7 @@ field = "flush_reqs"; if (field) { SV *val = hv_delete(RETVAL, params[i].field, strlen(params[i].field), 0); + SvREFCNT_inc(val); (void)hv_store(RETVAL, field, strlen(field), val, 0); } } @@ -5489,6 +5644,7 @@ REGISTER_CONSTANT(VIR_DOMAIN_SHUTDOWN, STATE_SHUTDOWN); REGISTER_CONSTANT(VIR_DOMAIN_SHUTOFF, STATE_SHUTOFF); REGISTER_CONSTANT(VIR_DOMAIN_CRASHED, STATE_CRASHED); + REGISTER_CONSTANT(VIR_DOMAIN_PMSUSPENDED, STATE_PMSUSPENDED); REGISTER_CONSTANT(VIR_DUMP_CRASH, DUMP_CRASH); REGISTER_CONSTANT(VIR_DUMP_LIVE, DUMP_LIVE); @@ -5517,6 +5673,7 @@ REGISTER_CONSTANT(VIR_DOMAIN_RUNNING_UNPAUSED, STATE_RUNNING_UNPAUSED); REGISTER_CONSTANT(VIR_DOMAIN_RUNNING_MIGRATION_CANCELED, STATE_RUNNING_MIGRATION_CANCELED); REGISTER_CONSTANT(VIR_DOMAIN_RUNNING_SAVE_CANCELED, STATE_RUNNING_SAVE_CANCELED); + REGISTER_CONSTANT(VIR_DOMAIN_RUNNING_WAKEUP, STATE_RUNNING_WAKEUP); REGISTER_CONSTANT(VIR_DOMAIN_BLOCKED_UNKNOWN, STATE_RUNNING_UNKNOWN); @@ -5544,8 +5701,13 @@ REGISTER_CONSTANT(VIR_DOMAIN_CRASHED_UNKNOWN, STATE_CRASHED_UNKNOWN); + REGISTER_CONSTANT(VIR_DOMAIN_PMSUSPENDED_UNKNOWN, STATE_PMSUSPENDED_UNKNOWN); + REGISTER_CONSTANT(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH, OPEN_GRAPHICS_SKIPAUTH); + REGISTER_CONSTANT(VIR_DOMAIN_CONSOLE_FORCE, OPEN_CONSOLE_FORCE); + REGISTER_CONSTANT(VIR_DOMAIN_CONSOLE_SAFE, OPEN_CONSOLE_SAFE); + /* NB: skip VIR_DOMAIN_SCHED_FIELD_* constants, because those are not used from Perl code - handled internally in the XS layer */ @@ -5559,6 +5721,7 @@ REGISTER_CONSTANT(VIR_MIGRATE_NON_SHARED_DISK, MIGRATE_NON_SHARED_DISK); REGISTER_CONSTANT(VIR_MIGRATE_NON_SHARED_INC, MIGRATE_NON_SHARED_INC); REGISTER_CONSTANT(VIR_MIGRATE_CHANGE_PROTECTION, MIGRATE_CHANGE_PROTECTION); + REGISTER_CONSTANT(VIR_MIGRATE_UNSAFE, MIGRATE_UNSAFE); REGISTER_CONSTANT(VIR_DOMAIN_XML_SECURE, XML_SECURE); @@ -5604,6 +5767,7 @@ REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STARTED_MIGRATED, EVENT_STARTED_MIGRATED); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STARTED_RESTORED, EVENT_STARTED_RESTORED); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT, EVENT_STARTED_FROM_SNAPSHOT); + REGISTER_CONSTANT(VIR_DOMAIN_EVENT_STARTED_WAKEUP, EVENT_STARTED_WAKEUP); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_SUSPENDED_PAUSED, EVENT_SUSPENDED_PAUSED); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED, EVENT_SUSPENDED_MIGRATED); @@ -5673,6 +5837,9 @@ REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_CONTROL_ERROR, EVENT_ID_CONTROL_ERROR); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_BLOCK_JOB, EVENT_ID_BLOCK_JOB); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_DISK_CHANGE, EVENT_ID_DISK_CHANGE); + REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_PMSUSPEND, EVENT_ID_PMSUSPEND); + REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_PMWAKEUP, EVENT_ID_PMWAKEUP); + REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_TRAY_CHANGE, EVENT_ID_TRAY_CHANGE); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_WATCHDOG_NONE, EVENT_WATCHDOG_NONE); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_WATCHDOG_PAUSE, EVENT_WATCHDOG_PAUSE); @@ -5695,6 +5862,9 @@ REGISTER_CONSTANT(VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START, EVENT_DISK_CHANGE_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); + REGISTER_CONSTANT_STR(VIR_DOMAIN_MEMORY_HARD_LIMIT, MEMORY_HARD_LIMIT); REGISTER_CONSTANT_STR(VIR_DOMAIN_MEMORY_SOFT_LIMIT, MEMORY_SOFT_LIMIT); REGISTER_CONSTANT_STR(VIR_DOMAIN_MEMORY_MIN_GUARANTEE, MEMORY_MIN_GUARANTEE); @@ -5732,6 +5902,9 @@ REGISTER_CONSTANT_STR(VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC, BLOCK_IOTUNE_WRITE_BYTES_SEC); + REGISTER_CONSTANT(VIR_DOMAIN_BLOCK_RESIZE_BYTES, BLOCK_RESIZE_BYTES); + + REGISTER_CONSTANT_STR(VIR_DOMAIN_NUMA_NODESET, NUMA_NODESET); REGISTER_CONSTANT_STR(VIR_DOMAIN_NUMA_MODE, NUMA_MODE); @@ -5789,6 +5962,7 @@ REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY, CREATE_DISK_ONLY); REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT, CREATE_REUSE_EXT); REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE, CREATE_QUIESCE); + REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC, CREATE_ATOMIC); REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS, LIST_ROOTS); REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS, LIST_DESCENDANTS); @@ -5916,6 +6090,8 @@ REGISTER_CONSTANT(VIR_FROM_LOCKING, FROM_LOCKING); REGISTER_CONSTANT(VIR_FROM_HYPERV, FROM_HYPERV); REGISTER_CONSTANT(VIR_FROM_CAPABILITIES, FROM_CAPABILITIES); + REGISTER_CONSTANT(VIR_FROM_AUTH, FROM_AUTH); + REGISTER_CONSTANT(VIR_FROM_URI, FROM_URI); REGISTER_CONSTANT(VIR_ERR_OK, ERR_OK); @@ -5999,4 +6175,6 @@ REGISTER_CONSTANT(VIR_ERR_OPERATION_ABORTED, ERR_OPERATION_ABORTED); REGISTER_CONSTANT(VIR_ERR_AUTH_CANCELLED, ERR_AUTH_CANCELLED); REGISTER_CONSTANT(VIR_ERR_NO_DOMAIN_METADATA, ERR_NO_DOMAIN_METADATA); + REGISTER_CONSTANT(VIR_ERR_MIGRATE_UNSAFE, ERR_MIGRATE_UNSAFE); + REGISTER_CONSTANT(VIR_ERR_OVERFLOW, ERR_OVERFLOW); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/lib/Sys/Virt/Domain.pm new/Sys-Virt-0.9.11/lib/Sys/Virt/Domain.pm --- old/Sys-Virt-0.9.10/lib/Sys/Virt/Domain.pm 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/lib/Sys/Virt/Domain.pm 2012-04-16 12:24:52.000000000 +0200 @@ -163,6 +163,10 @@ Resume execution of a domain previously halted with the C<suspend> method. +=item $dom->pm_wakeup() + +Wakeup the guest from power management suspend state + =item $dom->pm_suspend_for_duration($target, $duration, $flags=0) Tells the guest OS to enter the power management suspend state @@ -326,6 +330,10 @@ The guest is running after a resume +=item Sys::Virt::Domain::STATE_RUNNING_WAKEUP + +The guest is running after wakeup from power management suspend + =item Sys::Virt::Domain::STATE_SHUTDOWN_UNKNOWN It is not known why the domain has shutdown @@ -366,6 +374,10 @@ It is not known why the domain has shutoff +=item Sys::Virt::Domain::STATE_PMSUSPENDED_UNKNOWN + +It is not known why the domain was suspended + =back =item my $info = $dom->get_control_info($flags=0) @@ -552,10 +564,10 @@ Return the scheduler type for the guest domain -=item %stats = $dom->block_stats($path) +=item $stats = $dom->block_stats($path) Fetch the current I/O statistics for the block device given by C<$path>. -The returned hash contains keys for +The returned hash reference contains keys for =over 4 @@ -581,9 +593,11 @@ =back -=item my %params = $dom->get_scheduler_parameters($flags=0) +=item my $params = $dom->get_scheduler_parameters($flags=0) -Return the set of scheduler tunable parameters for the guest. +Return the set of scheduler tunable parameters for the guest, +as a hash reference. The precise set of keys in the hash +are specific to the hypervisor. =item $dom->set_scheduler_parameters($params, $flags=0) @@ -615,7 +629,7 @@ C<$params> should be a hash reference whose keys are one of the BLKIO PARAMETERS constants. -=item %stats = $dom->get_block_iotune($disk, $flags=0) +=item $stats = $dom->get_block_iotune($disk, $flags=0) Return a hash reference containing the set of blkio tunable parameters for the guest disk C<$disk>. The keys in the hash @@ -653,17 +667,18 @@ =item $dom->block_resize($disk, $newsize, $flags=0) -Resize the disk C<$disk> to have new size C<$newsize>. If the disk +Resize the disk C<$disk> to have new size C<$newsize> KB. If the disk is backed by a special image format, the actual resize is done by the hypervisor. If the disk is backed by a raw file, or block device, the resize must be done prior to invoking this API call, and it -merely updates the hypervisor's view of the disk size. +merely updates the hypervisor's view of the disk size. The following +flags may be used =over 4 -=item C<weight> +=item Sys::Virt::Domain::BLOCK_RESIZE_BYTES -Relative I/O weighting +Treat C<$newsize> as if it were in bytes, rather than KB. =back @@ -742,12 +757,13 @@ =back -=item %info = $dom->get_security_label() +=item $info = $dom->get_security_label() Fetch information about the security label assigned to the guest -domain. The returned hash has two keys, C<model> gives the name -of the security model in effect (eg C<selinux>), while C<label> -provides the name of the security label applied to the domain. +domain. The returned hash reference has two keys, C<model> gives +the name of the security model in effect (eg C<selinux>), while +C<label> provides the name of the security label applied to the +domain. =item $ddom = $dom->migrate(destcon, flags, dname, uri, bandwidth) @@ -812,13 +828,13 @@ =item $dom->migrate_set_max_speed($bandwidth, $flags) Set the maximum allowed bandwidth during migration of the guest. -The C<bandwidth> parameter is measured in kilobytes/second. +The C<bandwidth> parameter is measured in MB/second. The C<$flags> parameter is currently unused and defaults to zero. =item $bandwidth = $dom->migrate_get_max_speed($flag) Get the maximum allowed bandwidth during migration fo the guest. -The returned <bandwidth> value is measured in kilobytes/second. +The returned <bandwidth> value is measured in MB/second. The C<$flags> parameter is currently unused and defaults to zero. =item $dom->inject_nmi($flags) @@ -896,7 +912,7 @@ Change the maximum I/O bandwidth used by the block job that is currently executing for C<$path>. The C<$bandwidth> argument -is specified in KB/s +is specified in MB/s =item $dom->abort_block_job($path, $flags=0) @@ -907,13 +923,13 @@ Merge the backing files associated with C<$path> into the top level file. The C<$bandwidth> parameter specifies the -maximum I/O rate to allow in KB/s. +maximum I/O rate to allow in MB/s. =item $dom->block_rebase($path, $backingpath, $bandwith, $flags=0) Switch the backing path associated with C<$path> to instead use C<$backingpath>. The C<$bandwidth> parameter specifies the -maximum I/O rate to allow in KB/s. +maximum I/O rate to allow in MB/s. =item $count = $dom->num_of_snapshots() @@ -1092,6 +1108,10 @@ The domain is inactive, and crashed. +=item Sys::Virt::Domain::STATE_PMSUSPENDED + +The domain is active, but in power management suspend state + =back @@ -1250,6 +1270,25 @@ =back + +=head2 OPEN CONSOLE CONSTANTS + +The following constants are used when opening a connection +to the guest console + +=over 4 + +=item Sys::Virt::Domain::OPEN_CONSOLE_FORCE + +Force opening of the console, disconnecting any other +open session + +=item Sys::Virt::Domain::OPEN_CONSOLE_SAFE + +Check if the console driver supports safe operations + +=back + =head2 XML DUMP OPTIONS The following constants are used to control the information @@ -1398,6 +1437,11 @@ migration is taking place. This option is automatically implied if doing a peer-2-peer migration. +=item Sys::Virt::Domain::MIGRATE_UNSAFE + +Migrate even if the compatibility check indicates the migration +will be unsafe to the guest. + =back =head2 UNDEFINE CONSTANTS @@ -1733,6 +1777,10 @@ The domain was restored from a snapshot +=item Sys::Virt::Domain::EVENT_STARTED_WAKEUP + +The domain was woken up from suspend + =back =item Sys::Virt::Domain::EVENT_STOPPED @@ -1832,6 +1880,18 @@ =back +=item Sys::Virt::Domain::EVENT_PMSUSPENDED + +The domain has stopped running + +=over 4 + +=item Sys::Virt::Domain::EVENT_PMSUSPENDED_UNKNOWN + +The domain has suspend for an unknown reason + +=back + =back =head2 EVENT ID CONSTANTS @@ -1878,6 +1938,18 @@ Changes in disk media +=item Sys::Virt::Domain::EVENT_ID_TRAY_CHANGE + +CDROM media tray state + +=item Sys::Virt::Domain::EVENT_ID_PMSUSPEND + +Power management initiated suspend + +=item Sys::Virt::Domain::EVENT_ID_PMWAKEUP + +Power management initiated wakeup + =back =head2 IO ERROR EVENT CONSTANTS @@ -1986,6 +2058,22 @@ =back +=head2 TRAY CHANGE CONSTANTS + +These constants describe the reason for a tray change event + +=over 4 + +=item Sys::Virt::Domain::EVENT_TRAY_CHANGE_CLOSE + +The tray was closed + +=item Sys::Virt::Domain::EVENT_TRAY_CHANGE_OPEN + +The tray was opened + +=back + =head2 DOMAIN BLOCK JOB TYPE CONSTANTS The following constants identify the different types of domain diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/lib/Sys/Virt/DomainSnapshot.pm new/Sys-Virt-0.9.11/lib/Sys/Virt/DomainSnapshot.pm --- old/Sys-Virt-0.9.10/lib/Sys/Virt/DomainSnapshot.pm 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/lib/Sys/Virt/DomainSnapshot.pm 2012-04-16 12:24:52.000000000 +0200 @@ -159,6 +159,10 @@ Reuse the existing snapshot data files (if any) +=item Sys::Virt::DomainSnapshot::CREATE_ATOMIC + +Create multiple disk snapshots atomically + =back =head2 SNAPSHOT DELETION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/lib/Sys/Virt/Error.pm new/Sys-Virt-0.9.11/lib/Sys/Virt/Error.pm --- old/Sys-Virt-0.9.10/lib/Sys/Virt/Error.pm 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/lib/Sys/Virt/Error.pm 2012-04-16 12:24:52.000000000 +0200 @@ -314,6 +314,14 @@ The capabilities driver +=item Sys::Virt::Error::FROM_AUTH + +The authentication handling code + +=item Sys::Virt::Error::FROM_URI + +The URI handling code + =back =head2 ERROR CODE CONSTANTS @@ -648,6 +656,14 @@ The requested metadata does not exist +=item Sys::Virt::Error::ERR_MIGRATE_UNSAFE + +The migration operation would be unsafe to perform + +=item Sys::Virt::ERror::ERR_OVERFLOW + +The calculation would overflow + =back =head1 AUTHORS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/lib/Sys/Virt/StoragePool.pm new/Sys-Virt-0.9.11/lib/Sys/Virt/StoragePool.pm --- old/Sys-Virt-0.9.10/lib/Sys/Virt/StoragePool.pm 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/lib/Sys/Virt/StoragePool.pm 2012-04-16 12:24:52.000000000 +0200 @@ -150,10 +150,10 @@ Delete the storage pool. The C<$flags> parameter allows the data to be optionally wiped during delete and if omitted defaults to zero. -=item %info = $pool->get_info() +=item $info = $pool->get_info() Retrieve information about the current storage pool state. The -returned hash has the following keys +returned hash reference has the following keys =over 4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/lib/Sys/Virt/StorageVol.pm new/Sys-Virt-0.9.11/lib/Sys/Virt/StorageVol.pm --- old/Sys-Virt-0.9.10/lib/Sys/Virt/StorageVol.pm 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/lib/Sys/Virt/StorageVol.pm 2012-04-16 12:24:52.000000000 +0200 @@ -118,11 +118,11 @@ listed later. The C<flags> parameter is currently unused and defaults to zero. -=item my %info = $vol->get_info() +=item my $info = $vol->get_info() Retrieve live information about the storage volume. The returned -C<%info> hash contains three keys. C<type> indicates whether the -volume is a file or block device. C<capacity> provides the maximum +C<$info> hash reference contains three keys. C<type> indicates whether +the volume is a file or block device. C<capacity> provides the maximum logical size of the volume. C<allocation> provides the current physical usage of the volume. The allocation may be less than the capacity for sparse, or grow-on-demand volumes. The allocation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/lib/Sys/Virt.pm new/Sys-Virt-0.9.11/lib/Sys/Virt.pm --- old/Sys-Virt-0.9.10/lib/Sys/Virt.pm 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/lib/Sys/Virt.pm 2012-04-16 12:24:52.000000000 +0200 @@ -45,7 +45,14 @@ Any operations in the Sys::Virt API which have failure scenarios will result in an instance of the L<Sys::Virt::Error> module being thrown. To catch these errors, simply wrap the method in an eval -block. For details of the information contained in the error objects, +block: + + eval { my $vmm = Sys::Virt->new(address => $addr); }; + if ($@) { + print STDERR "Unable to open connection to $addr" . $@->message . "\n"; + } + +For details of the information contained in the error objects, consult the L<Sys::Virt::Error> manual page. =head1 METHODS @@ -71,7 +78,7 @@ use Sys::Virt::DomainSnapshot; use Sys::Virt::Stream; -our $VERSION = '0.9.10'; +our $VERSION = '0.9.11'; require XSLoader; XSLoader::load('Sys::Virt', $VERSION); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/perl-Sys-Virt.spec new/Sys-Virt-0.9.11/perl-Sys-Virt.spec --- old/Sys-Virt-0.9.10/perl-Sys-Virt.spec 2012-02-13 18:51:50.000000000 +0100 +++ new/Sys-Virt-0.9.11/perl-Sys-Virt.spec 2012-04-16 12:25:09.000000000 +0200 @@ -1,7 +1,7 @@ # Automatically generated by perl-Sys-Virt.spec.PL Name: perl-Sys-Virt -Version: 0.9.10 +Version: 0.9.11 Release: 1%{?dist}%{?extra_release} Summary: Represent and manage a libvirt hypervisor connection License: GPLv2+ or Artistic @@ -15,7 +15,7 @@ BuildRequires: perl(Test::CPAN::Changes) BuildRequires: perl(XML::XPath) BuildRequires: perl(Time::HiRes) -BuildRequires: libvirt-devel >= 0.9.10 +BuildRequires: libvirt-devel >= 0.9.11 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/perl-Sys-Virt.spec.PL new/Sys-Virt-0.9.11/perl-Sys-Virt.spec.PL --- old/Sys-Virt-0.9.10/perl-Sys-Virt.spec.PL 2012-02-13 18:51:36.000000000 +0100 +++ new/Sys-Virt-0.9.11/perl-Sys-Virt.spec.PL 2012-04-16 12:24:52.000000000 +0200 @@ -37,7 +37,7 @@ BuildRequires: perl(Test::CPAN::Changes) BuildRequires: perl(XML::XPath) BuildRequires: perl(Time::HiRes) -BuildRequires: libvirt-devel >= 0.9.10 +BuildRequires: libvirt-devel >= 0.9.11 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sys-Virt-0.9.10/t/030-api-coverage.t new/Sys-Virt-0.9.11/t/030-api-coverage.t --- old/Sys-Virt-0.9.10/t/030-api-coverage.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Sys-Virt-0.9.11/t/030-api-coverage.t 2012-04-16 12:24:52.000000000 +0200 @@ -0,0 +1,119 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use XML::XPath; + +use Test::More; + +unless ($ENV{TEST_MAINTAINER}) { + plan skip_all => "Test only for module maintainer. Set TEST_MAINTAINER=1 to run"; +} + +my $apifile = `pkg-config --variable=libvirt_api libvirt`; +chomp $apifile; + +open API, "<", $apifile or die "cannot read $apifile: $!"; +my $xml; +{ + local $/ = undef; + $xml = <API>; +}; +close API; + + +my $count = 0; + +my $xp = XML::XPath->new($xml); + +my @enums; +my @functions; + +my $set = $xp->find('/api/files/file/exports[@type="function"]/@symbol'); +foreach my $n ($set->get_nodelist) { + $count++; + push @functions, $n->getData(); +} + +$set = $xp->find('/api/files/file/exports[@type="enum"]/@symbol'); +foreach my $n ($set->get_nodelist) { + $count++; + push @enums, $n->getData(); +} + + +open XS, "<Virt.xs" or die "cannot read Virt.xs: $!"; + +my $xs; +{ + local $/ = undef; + $xs = <XS> +} +close XS; + +my @blacklist = qw( +virConnCopyLastError +virConnGetLastError +virConnResetLastError +virConnSetErrorFunc +virCopyLastError +virDefaultErrorFunc +virErrorFunc +virFreeError +virResetLastError +virSaveLastError + +virConnectAuthCallbackPtr +virConnectOpen +virConnectOpenReadOnly + +virConnectDomainEventBlockJobCallback +virConnectDomainEventCallback +virConnectDomainEventDiskChangeCallback +virConnectDomainEventGraphicsCallback +virConnectDomainEventIOErrorCallback +virConnectDomainEventIOErrorReasonCallback +virConnectDomainEventRTCChangeCallback +virConnectDomainEventWatchdogCallback +virConnectDomainEventPMSuspendCallback +virConnectDomainEventPMWakeupCallback +virConnectDomainEventTrayChangeCallback + +virEventAddHandleFunc +virEventAddTimeoutFunc +virEventRemoveHandleFunc +virEventRemoveTimeoutFunc +virEventUpdateHandleFunc +virEventUpdateTimeoutFunc + +virStreamEventCallback +virStreamSinkFunc +virStreamSourceFunc + +); + +foreach my $func (sort { $a cmp $b } @functions) { + if ($func =~ /(GetConnect|Ref|GetDomain)$/ || + grep {/$func/ } @blacklist) { + ok(1, $func); + next; + } + + ok($xs =~ /\b$func\b/, $func); +} + + +foreach my $enum (sort { $a cmp $b } @enums) { + if ($enum =~ /_LAST$/ || + $enum =~ /VIR_(TYPED_PARAM|DOMAIN_MEMORY_PARAM|DOMAIN_SCHED_FIELD|DOMAIN_BLKIO_PARAM)_(STRING|STRING_OKAY|BOOLEAN|DOUBLE|INT|LLONG|UINT|ULLONG)/ || + $enum eq "VIR_CPU_COMPARE_ERROR" || + $enum eq "VIR_DOMAIN_NONE" || + $enum eq "VIR_DOMAIN_MEMORY_STAT_NR") { + ok(1, $enum); + next; + } + + ok($xs =~ /REGISTER_CONSTANT(_STR)?\($enum,/, $enum); +} + +done_testing($count); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
