Introduce virNodeAllocPages

A long time ago in a galaxy far, far away it has been decided
that libvirt will manage not only domains but host as well. And
with my latest work on qemu driver supporting huge pages, we miss
the cherry on top: an API to allocate huge pages on the run.
Currently users are forced to log into the host and adjust the
huge pages pool themselves.  However, with this API the problem
is gone - they can both size up and size down the pool.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik
2014-09-25 10:24:44 +02:00
parent 4aa8a68faa
commit fa5c5580d6
8 changed files with 223 additions and 1 deletions
+16
View File
@@ -5616,6 +5616,22 @@ int virNodeGetFreePages(virConnectPtr conn,
unsigned int cellcount,
unsigned long long *counts,
unsigned int flags);
typedef enum {
VIR_NODE_ALLOC_PAGES_ADD = 0, /* Add @pageCounts to the pages pool. This
can be used only to size up the pool. */
VIR_NODE_ALLOC_PAGES_SET = (1 << 0), /* Don't add @pageCounts, instead set
passed number of pages. This can be
used to free allocated pages. */
} virNodeAllocPagesFlags;
int virNodeAllocPages(virConnectPtr conn,
unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
unsigned int flags);
/**
* virSchedParameterType:
*