Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index f2ecb1f..7ced3ff 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -312,6 +312,12 @@ <arg name="memory" type="t" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="SetMemoryStatsPeriod"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryStatsPeriod"/> + <arg name="period" type="i" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="SetMetadata"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata diff --git a/src/domain.c b/src/domain.c index c3c530e..1a62c21 100644 --- a/src/domain.c +++ b/src/domain.c @@ -1494,6 +1494,31 @@ virtDBusDomainSetMemory(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainSetMemoryStatsPeriod(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; + gint period; + guint flags; + + g_variant_get(inArgs, "(iu)", &period, &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainSetMemoryStatsPeriod(domain, period, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainSetMetadata(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1759,6 +1784,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "SendProcessSignal", virtDBusDomainSendProcessSignal }, { "SetVcpus", virtDBusDomainSetVcpus }, { "SetMemory", virtDBusDomainSetMemory }, + { "SetMemoryStatsPeriod", virtDBusDomainSetMemoryStatsPeriod }, { "SetMetadata", virtDBusDomainSetMetadata }, { "SetTime", virtDBusDomainSetTime }, { "SetUserPassword", virtDBusDomainSetUserPassword }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list