Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Connect.xml | 6 ++++++
src/connect.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 610dda7..e46d28d 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -200,6 +200,12 @@
value="See
https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSecurityMode...
<arg name="secModel" type="(ss)"
direction="out"/>
</method>
+ <method name="NodeSetMemoryParameters">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-host.html#virNodeSetMemoryParame...
+ <arg name="params" type="a{sv}"
direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<signal name="DomainEvent">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven...
diff --git a/src/connect.c b/src/connect.c
index 7495017..cea64cb 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -1031,6 +1031,36 @@ virtDBusConnectNodeGetSecurityModel(GVariant *inArgs
G_GNUC_UNUSED,
*outArgs = g_variant_new("((ss))", secmodel.model, secmodel.doi);
}
+static void
+virtDBusConnectNodeSetMemoryParameters(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath G_GNUC_UNUSED,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(GVariantIter) iter = NULL;
+ g_auto(virtDBusUtilTypedParams) params = { 0 };
+ guint flags;
+
+ g_variant_get(inArgs, "(a{sv}u)", &iter, &flags);
+
+ if (!virtDBusConnectOpen(connect, error))
+ return;
+
+ if (!virtDBusUtilGVariantToTypedParams(iter, ¶ms.params,
+ ¶ms.nparams, error)) {
+ return;
+ }
+
+ if (virNodeSetMemoryParameters(connect->connection, params.params,
+ params.nparams, flags) < 0) {
+ virtDBusUtilSetLastVirtError(error);
+ }
+}
+
static virtDBusGDBusPropertyTable virtDBusConnectPropertyTable[] = {
{ "Encrypted", virtDBusConnectGetEncrypted, NULL },
{ "Hostname", virtDBusConnectGetHostname, NULL },
@@ -1068,6 +1098,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
{ "NodeGetMemoryParameters", virtDBusConnectNodeGetMemoryParameters },
{ "NodeGetMemoryStats", virtDBusConnectNodeGetMemoryStats },
{ "NodeGetSecurityModel", virtDBusConnectNodeGetSecurityModel },
+ { "NodeSetMemoryParameters", virtDBusConnectNodeSetMemoryParameters },
{ 0 }
};
--
2.15.0