Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index c509b4e..3903689 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -97,6 +97,12 @@ <arg name="flags" type="u" direction="in"/> <arg name="stats" type="a{st}" direction="out"/> </method> + <method name="MigrateGetMaxDowntime"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxDowntime"/> + <arg name="flags" type="u" direction="in"/> + <arg name="downtime" type="t" direction="out"/> + </method> <method name="MigrateSetMaxDowntime"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime"/> diff --git a/src/domain.c b/src/domain.c index c42e1c6..e1b2d72 100644 --- a/src/domain.c +++ b/src/domain.c @@ -575,6 +575,36 @@ virtDBusDomainMemoryStats(GVariant *inArgs, *outArgs = g_variant_new_tuple(&gstats, 1); } +static void +virtDBusDomainMigrateGetMaxDowntime(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; + guint64 downtime; + guint flags; + gint ret; + + g_variant_get(inArgs, "(u)", &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret = virDomainMigrateGetMaxDowntime(domain, + (long long unsigned int *)&downtime, + flags); + if (ret < 0) + return virtDBusUtilSetLastVirtError(error); + + *outArgs = g_variant_new("(t)", downtime); +} + static void virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -757,6 +787,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, { "MemoryStats", virtDBusDomainMemoryStats }, + { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list