Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 631dabb..2d8f6fe 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -254,6 +254,12 @@ <arg name="flags" type="u" direction="in"/> <arg name="stats" type="a{st}" direction="out"/> </method> + <method name="MigrateGetCompressionCache"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetCompressionCache"/> + <arg name="flags" type="u" direction="in"/> + <arg name="cacheSize" type="t" direction="out"/> + </method> <method name="MigrateGetMaxDowntime"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxDowntime"/> diff --git a/src/domain.c b/src/domain.c index f6de3ac..b61e9f1 100644 --- a/src/domain.c +++ b/src/domain.c @@ -1301,6 +1301,35 @@ virtDBusDomainMemoryStats(GVariant *inArgs, *outArgs = g_variant_new_tuple(&gstats, 1); } +static void +virtDBusDomainMigrateGetCompressionCache(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect = userData; + g_autoptr(virDomain) domain = NULL; + gulong cacheSize; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainMigrateGetCompressionCache(domain, + (unsigned long long *)&cacheSize, + flags) < 0) { + return virtDBusUtilSetLastVirtError(error); + } + + *outArgs = g_variant_new("(t)", cacheSize); +} + static void virtDBusDomainMigrateGetMaxDowntime(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1971,6 +2000,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "ManagedSaveRemove", virtDBusDomainManagedSaveRemove }, { "MemoryPeek", virtDBusDomainMemoryPeek }, { "MemoryStats", virtDBusDomainMemoryStats }, + { "MigrateGetCompressionCache", virtDBusDomainMigrateGetCompressionCache }, { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateGetMaxSpeed", virtDBusDomainMigrateGetMaxSpeed }, { "MigrateSetCompressionCache", virtDBusDomainMigrateSetCompressionCache }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list