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 96b9220..4a69f25 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -410,6 +410,12 @@ <arg name="sigNum" type="u" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="SetBlkioParameters"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlkioParameters"/> + <arg name="params" type="a{sv}" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="SetMemory"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryFlags"/> diff --git a/src/domain.c b/src/domain.c index 76eec1d..726b90d 100644 --- a/src/domain.c +++ b/src/domain.c @@ -2127,6 +2127,38 @@ virtDBusDomainSendProcessSignal(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainSetBlkioParameters(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 (virDomainSetBlkioParameters(domain, params.params, + params.nparams, flags) < 0) { + virtDBusUtilSetLastVirtError(error); + } +} + static void virtDBusDomainSetMemory(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -2488,6 +2520,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "Save", virtDBusDomainSave }, { "SendKey", virtDBusDomainSendKey }, { "SendProcessSignal", virtDBusDomainSendProcessSignal }, + { "SetBlkioParameters", virtDBusDomainSetBlkioParameters }, { "SetVcpus", virtDBusDomainSetVcpus }, { "SetMemory", virtDBusDomainSetMemory }, { "SetMemoryStatsPeriod", virtDBusDomainSetMemoryStatsPeriod }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list