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 0f0ec79..a6edfec 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -240,6 +240,12 @@ <arg name="flags" type="u" direction="in"/> <arg name="bandwidth" type="t" direction="out"/> </method> + <method name="MigrateSetCompressionCache"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetCompressionCache"/> + <arg name="cacheSize" type="t" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </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 465daa6..e4146fe 100644 --- a/src/domain.c +++ b/src/domain.c @@ -1185,6 +1185,30 @@ virtDBusDomainMigrateGetMaxSpeed(GVariant *inArgs, *outArgs = g_variant_new("(t)", bandwidth); } +static void +virtDBusDomainMigrateSetCompressionCache(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 cacheSize; + guint flags; + + g_variant_get(inArgs, "(tu)", &cacheSize, &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainMigrateSetCompressionCache(domain, cacheSize, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1624,6 +1648,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "MemoryStats", virtDBusDomainMemoryStats }, { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateGetMaxSpeed", virtDBusDomainMigrateGetMaxSpeed }, + { "MigrateSetCompressionCache", virtDBusDomainMigrateSetCompressionCache }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, { "MigrateSetMaxSpeed", virtDBusDomainMigrateSetMaxSpeed }, { "MigrateStartPostCopy", virtDBusDomainMigrateStartPostCopy }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list