[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [libvirt-perl PATCH] Add migrate_get_max_downtime



Add new API for 3.7 pushed code for virDomainMigrateGetMaxDowntime

Signed-off-by: John Ferlan <jferlan redhat com>
---
 Changes                |  1 +
 Virt.xs                | 15 +++++++++++++++
 lib/Sys/Virt/Domain.pm |  6 ++++++
 3 files changed, 22 insertions(+)

diff --git a/Changes b/Changes
index e7f6cde..a3e507f 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for perl module Sys::Virt
 3.7.0 2017-00-00
 
  - Add VIR_FROM_RESCTRL constant
+ - Add migrate_get_max_downtime
 
 3.5.0 2017-07-06
 
diff --git a/Virt.xs b/Virt.xs
index d3019ee..11c3d8f 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -5325,6 +5325,21 @@ migrate_set_max_downtime(dom, downtime, flags=0)
          _croak_error();
 
 
+SV *
+migrate_get_max_downtime(dom, flags=0)
+      virDomainPtr dom;
+      unsigned int flags;
+  PREINIT:
+      unsigned long long downtime;
+    CODE:
+      if (virDomainMigrateGetMaxDowntime(dom, &downtime, flags) < 0)
+          _croak_error();
+
+      RETVAL = virt_newSVull(downtime);
+  OUTPUT:
+      RETVAL
+
+
 void
 migrate_set_max_speed(dom, bandwidth, flags=0)
      virDomainPtr dom;
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index 20ecf9f..030e1e3 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -1254,6 +1254,12 @@ at the cost of longer time blackout for the guest OS at the switch
 over point. The C<downtime> parameter is measured in milliseconds.
 The C<$flags> parameter is currently unused and defaults to zero.
 
+=item $downtime = $dom->migrate_get_max_downtime($flags=0)
+Get the current value of the maximum downtime allowed during a
+migration of a guest. The returned <downtime> value is measured
+in milliseconds. The C<$flags> parameter is currently unused and
+defaults to zero.
+
 =item $dom->migrate_set_max_speed($bandwidth, $flags=0)
 
 Set the maximum allowed bandwidth during migration of the guest.
-- 
2.9.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]