]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Teach cmdFreepages to work with lxc driver
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 2 Jul 2015 08:21:50 +0000 (10:21 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Jul 2015 09:48:14 +0000 (11:48 +0200)
commitf69ece073e4511957580824cfe6366a04bac7366
treeef2655890b1032dfd6a0910dea6f0cf311c6805f
parent416d0e94181086e572107ab9c295b70d98f0782b
virsh: Teach cmdFreepages to work with lxc driver

Some drivers don't expose available huge page sizes in the
capabilities XML. For instance, LXC driver is one of those.
This has a downside that when virsh is trying to get
aggregated info on free pages per all NUMA nodes, it fails.
The problem is that the virNodeGetFreePages() API expects
caller to pass an array of page sizes he is interested in.
In virsh, this array is filled from the capabilities from
'/capabilities/host/cpu/pages' XPath. As said, in LXC
there's no such XPath and therefore virsh fails currently.
But hey, we can fallback: the page sizes are exposed under
'/capabilities/host/topology/cells/cell/pages'. The page
size can be collected from there, and voilĂ  the command
works again. But now we must make sure that there are no
duplicates in the array passed to the public API. Otherwise
we won't get as beautiful output as we are getting now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-host.c