Re: [dbus PATCH 13/15] Implement GetNumaParameters method for Domain Interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 25, 2018 at 12:20:28PM +0200, Katerina Koukiou wrote:
> Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
> ---
>  data/org.libvirt.Domain.xml |  6 ++++++
>  src/domain.c                | 39 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+)
> 
> diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
> index 5557030..19ec861 100644
> --- a/data/org.libvirt.Domain.xml
> +++ b/data/org.libvirt.Domain.xml
> @@ -254,6 +254,12 @@
>        <arg name="flags" type="u" direction="in"/>
>        <arg name="metadata" type="s" direction="out"/>
>      </method>
> +    <method name="GetNumaParameters">
> +      <annotation name="org.gtk.GDBus.DocString"
> +        value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetNumaParameters"/>
> +      <arg name="flags" type="u" direction="in"/>
> +      <arg name="numaParameters" type="a{sv}" direction="out"/>
> +    </method>
>      <method name="GetSchedulerParameters">
>        <annotation name="org.gtk.GDBus.DocString"
>          value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParametersFlags"/>
> diff --git a/src/domain.c b/src/domain.c
> index 4cd6a4f..0df2b23 100644
> --- a/src/domain.c
> +++ b/src/domain.c
> @@ -1442,6 +1442,44 @@ virtDBusDomainGetMetadata(GVariant *inArgs,
>      *outArgs = g_variant_new("(s)", ret);
>  }
>  
> +static void
> +virtDBusDomainGetNumaParameters(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 };
> +    guint flags;
> +    gint ret;
> +    GVariant *grecords;
> +
> +    g_variant_get(inArgs, "(u)", &flags);
> +
> +    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
> +    if (!domain)
> +        return;
> +
> +    ret = virDomainGetNumaParameters(domain, NULL, &params.nparams, flags);
> +    if (ret < 0)
> +        return virtDBusUtilSetLastVirtError(error);
> +    if (ret == 0 && params.nparams != 0) {

No need to check for 'ret' 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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux