[dbus PATCH v3 08/20] Implement MigrateSetMaxDowntime method for Domain interface

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

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Domain.xml |  6 ++++++
 src/domain.c                | 25 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 074dd62..c3c64fa 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -96,6 +96,12 @@
       <arg name="flags" type="u" direction="in"/>
       <arg name="stats" type="a{st}" direction="out"/>
     </method>
+    <method name="MigrateSetMaxDowntime">
+      <annotation name="org.gtk.GDBus.DocString"
+        value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime"/>
+      <arg name="downtime" type="t" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="Reboot">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot"/>
diff --git a/src/domain.c b/src/domain.c
index b55a615..88e6aaa 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -585,6 +585,30 @@ virtDBusDomainMemoryStats(GVariant *inArgs,
     *outArgs = g_variant_new_tuple(&gstats, 1);
 }
 
+static void
+virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs,
+                                    GUnixFDList *inFDs G_GNUC_UNUSED,
+                                    const gchar *objectPath,
+                                    gpointer userData,
+                                    GVariant **outArgs G_GNUC_UNUSED,
+                                    GUnixFDList **outFDs G_GNUC_UNUSED,
+                                    GError **error)
+{
+    virtDBusConnect *connect = userData;
+    g_autoptr(virDomain) domain = NULL;
+    gulong downtime;
+    guint flags;
+
+    g_variant_get(inArgs, "(tu)", &downtime, &flags);
+
+    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+    if (!domain)
+        return;
+
+    if (virDomainMigrateSetMaxDowntime(domain, downtime, flags) < 0)
+        virtDBusUtilSetLastVirtError(error);
+}
+
 static void
 virtDBusDomainReboot(GVariant *inArgs,
                      GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -743,6 +767,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
     { "GetVcpus", virtDBusDomainGetVcpus },
     { "GetXMLDesc", virtDBusDomainGetXMLDesc },
     { "MemoryStats", virtDBusDomainMemoryStats },
+    { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime },
     { "Reboot", virtDBusDomainReboot },
     { "Reset", virtDBusDomainReset },
     { "Resume", virtDBusDomainResume },
-- 
2.15.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux