r68789 - in /branches/upstream/libsys-virt-perl/current: CHANGES META.yml Makefile.PL README Virt.xs lib/Sys/Virt.pm lib/Sys/Virt/Domain.pm perl-Sys-Virt.spec perl-Sys-Virt.spec.PL t/020-constants.t t/200-domains.t

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Wed Feb 16 12:37:42 UTC 2011


Author: carnil
Date: Wed Feb 16 12:36:30 2011
New Revision: 68789

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=68789
Log:
[svn-upgrade] new version libsys-virt-perl (0.2.5)

Modified:
    branches/upstream/libsys-virt-perl/current/CHANGES
    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/perl-Sys-Virt.spec
    branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec.PL
    branches/upstream/libsys-virt-perl/current/t/020-constants.t
    branches/upstream/libsys-virt-perl/current/t/200-domains.t

Modified: branches/upstream/libsys-virt-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/CHANGES?rev=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/CHANGES (original)
+++ branches/upstream/libsys-virt-perl/current/CHANGES Wed Feb 16 12:36:30 2011
@@ -1,12 +1,19 @@
 Sys::Virt ChangeLog
 ===================
 
-Since 0.2.3:
+New in 0.2.5:
+
+ - Add all APIs + constants from 0.8.2, 0.8.5 and 0.8.7
+   releases, with exception of virDomainOpenConsole
+ - Add missing dep on XML::XPath
+ - Requires libvirt >= 0.8.7
+
+New in 0.2.4:
 
  - Add all APIs + constants from 0.7.7, 0.8.0 & 0.8.1 releases
  - Requires libvirt >= 0.8.1
 
-Since 0.2.2:
+New in 0.2.3:
 
  - New virSecretPtr APIs
  - Fix authentication callback handling of NULLs
@@ -18,7 +25,7 @@
  - Add new error codes
  - Require libvirt >= 0.7.5
 
-Since 0.2.1:
+New in 0.2.2:
 
  - Add all new APIs upto libvirt 0.7.0 APIs (listing defined
    network interfaces)
@@ -28,7 +35,7 @@
  - Add missing APIs for defining network interfaces and
    starting defined interfaces
 
-Since 0.2.0:
+New in 0.2.1:
 
  - Add all new APIs upto libvirt 0.6.4 (network interfaces,
    storage volume cloning and node device create/delete)
@@ -39,14 +46,14 @@
  - Fix some memory leaks in C layer
  - Remove bogus module imports from test suite
 
-Since 0.1.2:
+New in 0.2.0:
 
  - Implement storage, node device, event APIs
  - Full covereage of all APIs in 0.6.1 release of libvirt
  - Full documentation coverage
  - Ability to authenticate when openning connections
 
-Since 0.1.1:
+New in 0.1.2:
 
  - Added manual written META.yml
  - Added networking APIs
@@ -56,7 +63,7 @@
  - Fix return values for reboot/shutdown/undefine/create APIs
  - Expanded documentation coverage
 
-Since 0.1.0:
+New in 0.1.1:
 
  - Fixed POD documentation names
  - Make Sys::Virt::Error use 'strict' and 'warnings' pragmas
@@ -69,7 +76,7 @@
    found by pkg-config
  - Added bindings for newly introduced APIs in libvirt 0.1.1
 
-Since 0.0.1:
+New in 0.1.0:
 
  - Added Sys::Virt->get_node_info mapping to virNodeGetInfo
  - Exposed the constants for domain state in Sys::Virt::Domain

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=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/META.yml (original)
+++ branches/upstream/libsys-virt-perl/current/META.yml Wed Feb 16 12:36:30 2011
@@ -1,7 +1,7 @@
 --- #YAML:1.0
 name:         Sys-Virt
 abstract:     Extension for the libvirt library
-version:      0.2.4
+version:      0.2.5
 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=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/Makefile.PL (original)
+++ branches/upstream/libsys-virt-perl/current/Makefile.PL Wed Feb 16 12:36:30 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.8.1";
+my $libvirtver = "0.8.7";
 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;
@@ -16,6 +16,7 @@
 	      'VERSION_FROM' => 'lib/Sys/Virt.pm',
 	      'PREREQ_PM' => {
 		  'Test::More'  => 0,
+		  'XML::XPath' => 0,
 		  },
 	      'AUTHOR' => 'Daniel Berrange <dan at berrange.com>',
 	      'LIBS' => [$LIBVIRT_LIBS],

Modified: branches/upstream/libsys-virt-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/README?rev=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/README (original)
+++ branches/upstream/libsys-virt-perl/current/README Wed Feb 16 12:36:30 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.8.1
+The current minimum required version of libvirt is 0.8.7
 
 -- 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=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/Virt.xs (original)
+++ branches/upstream/libsys-virt-perl/current/Virt.xs Wed Feb 16 12:36:30 2011
@@ -125,7 +125,28 @@
     newCONSTSUB(stash, name, valsv);
 }
 
+void
+_populate_constant_str(HV *stash, char *name, const char *value)
+{
+    SV *valsv;
+
+    valsv = newSVpv(value, strlen(value));
+    newCONSTSUB(stash, name, valsv);
+}
+
+void
+_populate_constant_ull(HV *stash, char *name, unsigned long long val)
+{
+    SV *valsv;
+
+    valsv = virt_newSVull(val);
+    newCONSTSUB(stash, name, valsv);
+}
+
+
 #define REGISTER_CONSTANT(name, key) _populate_constant(stash, #key, name)
+#define REGISTER_CONSTANT_STR(name, key) _populate_constant_str(stash, #key, name)
+#define REGISTER_CONSTANT_ULL(name, key) _populate_constant_ull(stash, #key, name)
 
 static int
 _domain_event_lifecycle_callback(virConnectPtr con,
@@ -1494,14 +1515,19 @@
 MODULE = Sys::Virt::Domain  PACKAGE = Sys::Virt::Domain
 
 virDomainPtr
-_create_linux(con, xml)
+_create(con, xml, flags=0)
       virConnectPtr con;
       const char *xml;
-    CODE:
-      /* Don't bother using virDomainCreateXML, since this works
-         for more versions */
-      if (!(RETVAL = virDomainCreateLinux(con, xml, 0))) {
-	_croak_error(virConnGetLastError(con));
+      unsigned int flags;
+    CODE:
+      if (flags) {
+        if (!(RETVAL = virDomainCreateXML(con, xml, flags))) {
+  	  _croak_error(virConnGetLastError(con));
+        }
+      } else {
+        if (!(RETVAL = virDomainCreateLinux(con, xml, 0))) {
+	  _croak_error(virConnGetLastError(con));
+        }
       }
   OUTPUT:
       RETVAL
@@ -1624,6 +1650,17 @@
       virDomainPtr dom;
     CODE:
       if ((RETVAL = virDomainIsPersistent(dom)) < 0) {
+          _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+      }
+  OUTPUT:
+      RETVAL
+
+
+int
+is_updated(dom)
+      virDomainPtr dom;
+    CODE:
+      if ((RETVAL = virDomainIsUpdated(dom)) < 0) {
           _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
       }
   OUTPUT:
@@ -1886,6 +1923,124 @@
       Safefree(params);
 
 
+HV *
+get_memory_parameters(dom)
+      virDomainPtr dom;
+  PREINIT:
+      virMemoryParameter *params;
+      int nparams;
+      unsigned int i;
+    CODE:
+      nparams = 0;
+      if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) < 0) {
+          _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+      }
+
+      RETVAL = (HV *)sv_2mortal((SV*)newHV());
+      Newx(params, nparams, virMemoryParameter);
+
+      if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
+          Safefree(params);
+          _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+      }
+
+      for (i = 0 ; i < nparams ; i++) {
+          SV *val = NULL;
+
+          switch (params[i].type) {
+          case VIR_DOMAIN_SCHED_FIELD_INT:
+              val = newSViv(params[i].value.i);
+              break;
+
+          case VIR_DOMAIN_SCHED_FIELD_UINT:
+              val = newSViv((int)params[i].value.ui);
+              break;
+
+          case VIR_DOMAIN_SCHED_FIELD_LLONG:
+              val = virt_newSVll(params[i].value.l);
+              break;
+
+          case VIR_DOMAIN_SCHED_FIELD_ULLONG:
+              val = virt_newSVull(params[i].value.ul);
+              break;
+
+          case VIR_DOMAIN_SCHED_FIELD_DOUBLE:
+              val = newSVnv(params[i].value.d);
+              break;
+
+          case VIR_DOMAIN_SCHED_FIELD_BOOLEAN:
+              val = newSViv(params[i].value.b);
+              break;
+          }
+
+          (void)hv_store(RETVAL, params[i].field, strlen(params[i].field), val, 0);
+      }
+      Safefree(params);
+  OUTPUT:
+      RETVAL
+
+void
+set_memory_parameters(dom, newparams)
+      virDomainPtr dom;
+      HV *newparams;
+  PREINIT:
+      virMemoryParameter *params;
+      int nparams;
+      unsigned int i;
+    PPCODE:
+      nparams = 0;
+      if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) < 0) {
+          _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+      }
+
+      Newx(params, nparams, virMemoryParameter);
+
+      if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
+          Safefree(params);
+          _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+      }
+
+      for (i = 0 ; i < nparams ; i++) {
+	SV **val;
+
+	if (!hv_exists(newparams, params[i].field, strlen(params[i].field)))
+	  continue;
+
+	val = hv_fetch (newparams, params[i].field, strlen(params[i].field), 0);
+
+	switch (params[i].type) {
+	case VIR_DOMAIN_SCHED_FIELD_INT:
+	  params[i].value.i = SvIV(*val);
+	  break;
+
+	case VIR_DOMAIN_SCHED_FIELD_UINT:
+	  params[i].value.ui = SvIV(*val);
+	  break;
+
+	case VIR_DOMAIN_SCHED_FIELD_LLONG:
+	  params[i].value.l = virt_SvIVll(*val);
+	  break;
+
+	case VIR_DOMAIN_SCHED_FIELD_ULLONG:
+	  params[i].value.ul = virt_SvIVull(*val);
+	  break;
+
+	case VIR_DOMAIN_SCHED_FIELD_DOUBLE:
+	  params[i].value.d = SvNV(*val);
+	  break;
+
+	case VIR_DOMAIN_SCHED_FIELD_BOOLEAN:
+	  params[i].value.b = SvIV(*val);
+	  break;
+	}
+
+      }
+      if (virDomainSetMemoryParameters(dom, params, nparams, 0) < 0) {
+	_croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+      }
+      Safefree(params);
+
+
 unsigned long
 get_max_memory(dom)
       virDomainPtr dom;
@@ -1927,13 +2082,32 @@
 
 
 void
-set_vcpus(dom, num)
+set_vcpus(dom, num, flags=0)
       virDomainPtr dom;
       int num;
-  PPCODE:
-      if (virDomainSetVcpus(dom, num) < 0) {
-	_croak_error(virConnGetLastError(virDomainGetConnect(dom)));
-      }
+      int flags;
+  PPCODE:
+      if (flags) {
+          if (virDomainSetVcpusFlags(dom, num, flags) < 0) {
+              _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+          }
+      } else {
+          if (virDomainSetVcpus(dom, num) < 0) {
+              _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+          }
+      }
+
+int
+get_vcpus(dom, flags=0)
+    virDomainPtr dom;
+    int flags;
+  CODE:
+    if ((RETVAL = virDomainGetVcpusFlags(dom, flags)) < 0) {
+        _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+    }
+OUTPUT:
+    RETVAL
+
 
 
 void
@@ -2027,13 +2201,19 @@
       }
 
 void
-create(dom)
-      virDomainPtr dom;
+create(dom, flags=0)
+      virDomainPtr dom;
+      unsigned int flags;
     PPCODE:
-      if (virDomainCreate(dom) < 0) {
-	_croak_error(virConnGetLastError(virDomainGetConnect(dom)));
-      }
-
+      if (flags) {
+        if (virDomainCreateWithFlags(dom, flags) < 0) {
+	  _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+        }
+      } else {
+        if (virDomainCreate(dom) < 0) {
+	  _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+        }
+      }
 
 virDomainPtr
 migrate(dom, destcon, flags=0, dname=&PL_sv_undef, uri=&PL_sv_undef, bandwidth=0)
@@ -3805,10 +3985,7 @@
       REGISTER_CONSTANT(VIR_DOMAIN_SHUTOFF, STATE_SHUTOFF);
       REGISTER_CONSTANT(VIR_DOMAIN_CRASHED, STATE_CRASHED);
 
-      /*
-       * This constant is not really useful yet
-      REGISTER_CONSTANT(VIR_DOMAIN_NONE, CREATE_NONE);
-      */
+      REGISTER_CONSTANT(VIR_DOMAIN_START_PAUSED, START_PAUSED);
 
       /* NB: skip VIR_DOMAIN_SCHED_FIELD_* constants, because
          those are not used from Perl code - handled internally
@@ -3899,6 +4076,17 @@
 
       REGISTER_CONSTANT(VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4, EVENT_GRAPHICS_ADDRESS_IPV4);
       REGISTER_CONSTANT(VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6, EVENT_GRAPHICS_ADDRESS_IPV6);
+
+
+      REGISTER_CONSTANT_ULL(VIR_DOMAIN_MEMORY_PARAM_UNLIMITED, MEMORY_PARAM_UNLIMITED);
+
+      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);
+      REGISTER_CONSTANT_STR(VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT, MEMORY_SWAP_HARD_LIMIT);
+
+      REGISTER_CONSTANT(VIR_DOMAIN_VCPU_LIVE, VCPU_LIVE);
+      REGISTER_CONSTANT(VIR_DOMAIN_VCPU_CONFIG, VCPU_CONFIG);
 
       stash = gv_stashpv( "Sys::Virt::StoragePool", TRUE );
       REGISTER_CONSTANT(VIR_STORAGE_POOL_INACTIVE, STATE_INACTIVE);

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=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm (original)
+++ branches/upstream/libsys-virt-perl/current/lib/Sys/Virt.pm Wed Feb 16 12:36:30 2011
@@ -70,7 +70,7 @@
 use Sys::Virt::NWFilter;
 use Sys::Virt::DomainSnapshot;
 
-our $VERSION = '0.2.4';
+our $VERSION = '0.2.5';
 require XSLoader;
 XSLoader::load('Sys::Virt', $VERSION);
 
@@ -191,20 +191,22 @@
 }
 
 
-=item my $dom = $vmm->create_domain($xml);
+=item my $dom = $vmm->create_domain($xml, $flags);
 
 Create a new domain based on the XML description passed into the C<$xml>
 parameter. The returned object is an instance of the L<Sys::Virt::Domain>
 class. This method is not available with unprivileged connections to
-the VMM.
+the VMM. The C<$flags> parameter accepts one of the DOMAIN CREATION
+constants documented in L<Sys::Virt::Domain>, and defaults to 0 if omitted.
 
 =cut
 
 sub create_domain {
     my $self = shift;
     my $xml = shift;
-
-    return Sys::Virt::Domain->_new(connection => $self, xml => $xml);
+    my $flags = shift || 0;
+
+    return Sys::Virt::Domain->_new(connection => $self, xml => $xml, flags => $flags);
 }
 
 =item my $dom = $vmm->define_domain($xml);
@@ -356,7 +358,6 @@
 
     my $nids = $self->num_of_domains();
     my @ids = $self->list_domain_ids($nids);
-
     my @domains;
     foreach my $id (@ids) {
 	eval {

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=68789&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 Wed Feb 16 12:36:30 2011
@@ -64,7 +64,7 @@
 	if ($params{nocreate}) {
 	    $self = Sys::Virt::Domain::_define_xml($con,  $params{xml});
 	} else {
-	    $self = Sys::Virt::Domain::_create_linux($con,  $params{xml});
+	    $self = Sys::Virt::Domain::_create($con,  $params{xml}, $params{flags});
 	}
     } else {
 	die "address, id or uuid parameters are required";
@@ -104,6 +104,12 @@
 Returns a true value if the domain has a persistent configuration
 file defined
 
+=item $dom->is_updated()
+
+Returns a true value if the domain is running and has a persistent
+configuration file defined that is out of date compared to the
+current live config.
+
 =item my $xml = $dom->get_xml_description()
 
 Returns an XML document containing a complete description of
@@ -114,10 +120,12 @@
 Returns a string containing the name of the OS type running
 within the domain.
 
-=item $dom->create()
+=item $dom->create($flags)
 
 Start a domain whose configuration was previously defined using the
-C<define_domain> method in L<Sys::Virt>.
+C<define_domain> method in L<Sys::Virt>. The C<$flags> parameter
+accepts one of the DOMAIN CREATION constants documented later, and
+defaults to 0 if omitted.
 
 =item $dom->undefine()
 
@@ -306,9 +314,17 @@
 Set the state of the autostart flag, which determines whether the
 guest will automatically start upon boot of the host OS
 
-=item $dom->set_vcpus($count)
-
-Set the number of virtual CPUs in the guest VM to C<$count>
+=item $dom->set_vcpus($count, [$flags])
+
+Set the number of virtual CPUs in the guest VM to C<$count>.
+The optional C<$flags> parameter can be used to control whether
+the setting changes the live config or inactive config.
+
+=item $count = $dom->get_vcpus([$flags])
+
+Get the number of virtual CPUs in the guest VM.
+The optional C<$flags> parameter can be used to control whether
+to query the setting of the live config or inactive config.
 
 =item $type = $dom->get_scheduler_type()
 
@@ -328,6 +344,18 @@
 Update the set of scheduler tunable parameters. The value names for
 tunables vary, and can be discovered using the C<get_scheduler_params>
 call
+
+=item my $params = $dom->get_memory_parameters()
+
+Return a hash reference containing the set of memory tunable
+parameters for the guest. The keys in the hash are one of the
+constants MEMORY PARAMETERS described later.
+
+=item $dom->set_memory_parameters($params)
+
+Update the memory tunable parameters for the guest. The
+C<$params> should be a hash reference whose keys are one
+of the MEMORY PARAMETERS constants.
 
 =over 4
 
@@ -658,6 +686,20 @@
 =back
 
 
+=head2 DOMAIN CREATION
+
+The following constants can be used to control the behaviour
+of domain creation
+
+=over 4
+
+=item Sys::Virt::Domain::START_PAUSED
+
+Keep the guest vCPUs paused after starting the guest
+
+=back
+
+
 =head2 MEMORY PEEK
 
 The following constants can be used with the C<memory_peek>
@@ -805,6 +847,53 @@
 =item Sys::Virt::Domain::JOB_CANCELLED
 
 The job was aborted at user request, but isn't cleaned up
+
+=back
+
+
+=head2 MEMORY PARAMETERS
+
+The following constants are useful when getting/setting
+memory parameters for guests
+
+=over 4
+
+=item Sys::Virt::Domain::MEMORY_HARD_LIMIT
+
+The maximum memory the guest can use.
+
+=item Sys::Virt::Domain::MEMORY_SOFT_LIMIT
+
+The memory upper limit enforced during memory contention.
+
+=item Sys::Virt::Domain::MEMORY_MIN_GUARANTEE
+
+The minimum memory guaranteed to be reserved for the guest.
+
+=item Sys::Virt::Domain::MEMORY_SWAP_HARD_LIMIT
+
+The maximum swap the guest can use.
+
+=item Sys::Virt::Domain::MEMORY_PARAM_UNLIMITED
+
+The value that indicates "unlimited"
+
+=back
+
+=head2 VCPU FLAGS
+
+The following constants are useful when getting/setting the
+VCPU count for a guest
+
+=over 4
+
+=item Sys::Virt::Domain::VCPU_LIVE
+
+Flag to request the live value
+
+=item Sys::Virt::Domain::VCPU_CONFIG
+
+Flag to request the persistent config value
 
 =back
 

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=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec (original)
+++ branches/upstream/libsys-virt-perl/current/perl-Sys-Virt.spec Wed Feb 16 12:36:30 2011
@@ -12,15 +12,15 @@
 
 Summary: Sys::Virt - Perl API to libvirt library
 Name: perl-%{appname}
-Version: 0.2.4
+Version: 0.2.5
 Release: 1%{_extra_release}
 License: GPLv2 or Artistic
 Group: Development/Tools
 Source: %{appname}-%{version}.tar.gz
 BuildRoot: /var/tmp/%{appname}-%{version}-root
 Requires: perl >= %{perlversion}
-Requires: libvirt-client >= 0.8.1
-BuildRequires: libvirt-devel >= 0.8.1
+Requires: libvirt-client >= 0.8.7
+BuildRequires: libvirt-devel >= 0.8.7
 BuildRequires: perl(Test::More)
 BuildRequires: perl(Time::HiRes)
 

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=68789&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 Wed Feb 16 12:36:30 2011
@@ -41,8 +41,8 @@
 Source: %{appname}-%{version}.tar.gz
 BuildRoot: /var/tmp/%{appname}-%{version}-root
 Requires: perl >= %{perlversion}
-Requires: libvirt-client >= 0.8.1
-BuildRequires: libvirt-devel >= 0.8.1
+Requires: libvirt-client >= 0.8.7
+BuildRequires: libvirt-devel >= 0.8.7
 BuildRequires: perl(Test::More)
 BuildRequires: perl(Time::HiRes)
 

Modified: branches/upstream/libsys-virt-perl/current/t/020-constants.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/t/020-constants.t?rev=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/t/020-constants.t (original)
+++ branches/upstream/libsys-virt-perl/current/t/020-constants.t Wed Feb 16 12:36:30 2011
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 10;
+use Test::More tests => 15;
 
 BEGIN {
   use_ok("Sys::Virt") or die;
@@ -18,3 +18,8 @@
 is(Sys::Virt::CRED_REALM, 8, "CRED_REALM");
 is(Sys::Virt::CRED_EXTERNAL, 9, "CRED_EXTERNAL");
 
+is(Sys::Virt::Domain::MEMORY_HARD_LIMIT, "hard_limit", "hard limit");
+is(Sys::Virt::Domain::MEMORY_SOFT_LIMIT, "soft_limit", "soft limit");
+is(Sys::Virt::Domain::MEMORY_MIN_GUARANTEE, "min_guarantee", "min guarantee");
+is(Sys::Virt::Domain::MEMORY_SWAP_HARD_LIMIT, "swap_hard_limit", "swap hard limit");
+is(Sys::Virt::Domain::MEMORY_PARAM_UNLIMITED, "9007199254740991", "param unlimited");

Modified: branches/upstream/libsys-virt-perl/current/t/200-domains.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsys-virt-perl/current/t/200-domains.t?rev=68789&op=diff
==============================================================================
--- branches/upstream/libsys-virt-perl/current/t/200-domains.t (original)
+++ branches/upstream/libsys-virt-perl/current/t/200-domains.t Wed Feb 16 12:36:30 2011
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 43;
+use Test::More tests => 56;
 
 BEGIN {
         use_ok('Sys::Virt');
@@ -28,6 +28,7 @@
 is($dom->get_id, "1", "id");
 ok($dom->is_persistent(), "domain is persistent");
 ok($dom->is_active(), "domain is active");
+ok(!$dom->is_updated(), "domain is not updated");
 
 # Lookup again via UUID to verify we get the same
 my $uuid = $dom->get_uuid();
@@ -144,3 +145,38 @@
 is_deeply(\@names, [], "names");
 
 
+
+$conn->create_domain($xml);
+
+$nname = $conn->num_of_domains();
+is($nname, 2, "1 domain");
+
+ at ids = sort { $a <=> $b} $conn->list_domain_ids($nname);
+is_deeply(\@ids, [1, 3], "domain ids");
+
+ at doms = $conn->list_domains();
+is($#doms, 1, "2 domains");
+isa_ok($doms[0], "Sys::Virt::Domain");
+isa_ok($doms[1], "Sys::Virt::Domain");
+
+$dom = $conn->get_domain_by_name("wibble");
+isa_ok($dom, "Sys::Virt::Domain");
+
+ok(!$dom->is_persistent(), "domain is not persistent");
+ok($dom->is_active(), "domain is active");
+
+$dom->destroy();
+
+
+$nname = $conn->num_of_domains();
+is($nname, 1, "1 domains");
+
+ at ids = $conn->list_domain_ids($nname);
+is_deeply(\@ids, [1], "ids");
+
+$nname = $conn->num_of_defined_domains();
+is($nname, 0, "0 defined domain");
+
+ at names = $conn->list_defined_domain_names($nname);
+is_deeply(\@names, [], "names");
+




More information about the Pkg-perl-cvs-commits mailing list