Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index a7b0d22..7bbe520 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -423,6 +423,12 @@ <arg name="params" type="a{sv}" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="SetInterfaceParameters"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfaceParameters"/> + <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 51ab3ec..fb8db94 100644 --- a/src/domain.c +++ b/src/domain.c @@ -2192,6 +2192,39 @@ virtDBusDomainSetBlockIOTune(GVariant *inArgs, } } +static void +virtDBusDomainSetInterfaceParameters(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 }; + const gchar *device; + guint flags; + + g_variant_get(inArgs, "(&sa{sv}u)", &device, &iter, &flags); + + if (!virtDBusUtilGVariantToTypedParams(iter, ¶ms.params, + ¶ms.nparams, error)) { + return; + } + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainSetInterfaceParameters(domain, device, params.params, + params.nparams, flags) < 0) { + virtDBusUtilSetLastVirtError(error); + } +} + static void virtDBusDomainSetMemory(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -2555,6 +2588,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "SendProcessSignal", virtDBusDomainSendProcessSignal }, { "SetBlkioParameters", virtDBusDomainSetBlkioParameters }, { "SetBlockIOTune", virtDBusDomainSetBlockIOTune }, + { "SetInterfaceParameters", virtDBusDomainSetInterfaceParameters }, { "SetVcpus", virtDBusDomainSetVcpus }, { "SetMemory", virtDBusDomainSetMemory }, { "SetMemoryStatsPeriod", virtDBusDomainSetMemoryStatsPeriod }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list