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, ¶ms.nparams, flags); + if (ret < 0) + return virtDBusUtilSetLastVirtError(error); + if (ret == 0 && params.nparams != 0) { + params.params = g_new0(virTypedParameter, params.nparams); + if (virDomainGetNumaParameters(domain, params.params, + ¶ms.nparams, flags) < 0) { + return virtDBusUtilSetLastVirtError(error); + } + } + + grecords = virtDBusUtilTypedParamsToGVariant(params.params, params.nparams); + + *outArgs = g_variant_new_tuple(&grecords, 1); +} + static void virtDBusDomainGetSchedulerParameters(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -2457,6 +2495,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "GetJobStats", virtDBusDomainGetJobStats }, { "GetMemoryParameters", virtDBusDomainGetMemoryParameters }, { "GetMetadata", virtDBusDomainGetMetadata }, + { "GetNumaParameters", virtDBusDomainGetNumaParameters }, { "GetSchedulerParameters", virtDBusDomainGetSchedulerParameters }, { "GetStats", virtDBusDomainGetStats }, { "GetTime", virtDBusDomainGetTime }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list