Signed-off-by: Katerina Koukiou <kkouk...@redhat.com>
---
 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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to