Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 12b5aa0..8670582 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -469,6 +469,12 @@ <arg name="params" type="a{sv}" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="SetSchedulerParameters"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParameters"/> + <arg name="params" type="a{sv}" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="SetUserPassword"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetUserPassword"/> diff --git a/src/domain.c b/src/domain.c index 5d3b810..ec5b99c 100644 --- a/src/domain.c +++ b/src/domain.c @@ -2410,6 +2410,38 @@ virtDBusDomainSetPerfEvents(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainSetSchedulerParameters(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; + g_autoptr(GVariantIter) iter = NULL; + g_auto(virtDBusUtilTypedParams) params = { 0 }; + guint flags; + + g_variant_get(inArgs, "(a{sv}u)", &iter, &flags); + + if (!virtDBusUtilGVariantToTypedParams(iter, ¶ms.params, + ¶ms.nparams, error)) { + return; + } + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainSetSchedulerParametersFlags(domain, params.params, + params.nparams, flags) < 0) { + virtDBusUtilSetLastVirtError(error); + } +} + static void virtDBusDomainSetUserPassword(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -2660,6 +2692,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "SetMetadata", virtDBusDomainSetMetadata }, { "SetNumaParameters", virtDBusDomainSetNumaParameters }, { "SetPerfEvents", virtDBusDomainSetPerfEvents }, + { "SetSchedulerParameters", virtDBusDomainSetSchedulerParameters }, { "SetTime", virtDBusDomainSetTime }, { "SetUserPassword", virtDBusDomainSetUserPassword }, { "Shutdown", virtDBusDomainShutdown }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list