[libvirt] [dbus PATCH 01/10] Implement NodeGetCellsFreeMemory method for Connect Interface

Pavel Hrdina phrdina at redhat.com
Fri Apr 27 13:13:14 UTC 2018


On Thu, Apr 26, 2018 at 04:54:08PM +0200, Katerina Koukiou wrote:
> Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
> ---
>  data/org.libvirt.Connect.xml |  7 +++++++
>  src/connect.c                | 39 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 46 insertions(+)
> 
> diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
> index ee7bfdc..1502849 100644
> --- a/data/org.libvirt.Connect.xml
> +++ b/data/org.libvirt.Connect.xml
> @@ -166,6 +166,13 @@
>        <arg name="uuid" type="s" direction="in"/>
>        <arg name="network" type="o" direction="out"/>
>      </method>
> +    <method name="NodeGetCellsFreeMemory">
> +      <annotation name="org.gtk.GDBus.DocString"
> +          value="See https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCellsFreeMemory"/>
> +      <arg name="startCell" type="i" direction="in"/>
> +      <arg name="maxCells" type="i" direction="in"/>
> +      <arg name="freeMems" type="at" direction="out"/>
> +    </method>

Another example of bad design of libvirt API.  We can do a better job in
libvirt-dbus to always return an array of free memory for all NUMA
nodes.

However, there is no other way how to get the number of NUMA nodes
except for parsing XML output of virConnectGetCapabilities() API. That
means that we need to use libxml2 library to parse the XML.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180427/1a6e208c/attachment-0001.sig>


More information about the libvir-list mailing list