On Wed, Apr 25, 2018 at 12:20:24PM +0200, Katerina Koukiou wrote: > Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> > --- > data/org.libvirt.Domain.xml | 7 +++++++ > src/domain.c | 41 +++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 48 insertions(+) > > diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml > index 1324db8..84ef3bf 100644 > --- a/data/org.libvirt.Domain.xml > +++ b/data/org.libvirt.Domain.xml > @@ -215,6 +215,13 @@ > <arg name="flags" type="u" direction="in"/> > <arg name="hostname" type="s" direction="out"/> > </method> > + <method name="GetInterfaceParameters"> > + <annotation name="org.gtk.GDBus.DocString" > + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInterfaceParameters"/> > + <arg name="device" type="s" direction="in"/> > + <arg name="flags" type="u" direction="in"/> > + <arg name="interfaceParameters" type="a{sv}" direction="out"/> > + </method> > <method name="GetJobInfo"> > <annotation name="org.gtk.GDBus.DocString" > value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo"/> > diff --git a/src/domain.c b/src/domain.c > index 18ca7aa..3c1fec7 100644 > --- a/src/domain.c > +++ b/src/domain.c > @@ -1179,6 +1179,46 @@ virtDBusDomainGetHostname(GVariant *inArgs, > *outArgs = g_variant_new("(s)", hostname); > } > > +static void > +virtDBusDomainGetInterfaceParameters(GVariant *inArgs, > + GUnixFDList *inFDs G_GNUC_UNUSED, > + const gchar *objectPath, > + gpointer userData, > + GVariant **outArgs, > + GUnixFDList **outFDs G_GNUC_UNUSED, > + GError **error) > +{ > + virtDBusConnect *connect = userData; > + g_autoptr(virDomain) domain = NULL; > + g_auto(virtDBusUtilTypedParams) params = { 0 }; > + const gchar *device; > + guint flags; > + gint ret; > + GVariant *grecords; > + > + g_variant_get(inArgs, "(&su)", &device, &flags); > + > + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); > + if (!domain) > + return; > + > + ret = virDomainGetInterfaceParameters(domain, device, NULL, > + ¶ms.nparams, flags); > + if (ret < 0) > + return virtDBusUtilSetLastVirtError(error); > + if (ret == 0 && params.nparams != 0) { There is no need to check the 'ret' variable here. Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
Attachment:
signature.asc
Description: PGP signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list