unsigned int cellCount,
unsigned int flags)
{
+ virLXCDriver *driver = conn->privateData;
+ g_autoptr(virCaps) caps = NULL;
+ int lastCell;
bool add = !(flags & VIR_NODE_ALLOC_PAGES_SET);
virCheckFlags(VIR_NODE_ALLOC_PAGES_SET, -1);
if (virNodeAllocPagesEnsureACL(conn) < 0)
return -1;
+ if (!(caps = virLXCDriverGetCapabilities(driver, false)))
+ return -1;
+
+ lastCell = virCapabilitiesHostNUMAGetMaxNode(caps->host.numa);
+
return virHostMemAllocPages(npages, pageSizes, pageCounts,
- startCell, cellCount, add);
+ startCell, cellCount,
+ lastCell, add);
}
unsigned int cellCount,
unsigned int flags)
{
+ virQEMUDriver *driver = conn->privateData;
+ g_autoptr(virCaps) caps = NULL;
+ int lastCell;
bool add = !(flags & VIR_NODE_ALLOC_PAGES_SET);
virCheckFlags(VIR_NODE_ALLOC_PAGES_SET, -1);
if (virNodeAllocPagesEnsureACL(conn) < 0)
return -1;
+ if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
+ return -1;
+
+ lastCell = virCapabilitiesHostNUMAGetMaxNode(caps->host.numa);
+
return virHostMemAllocPages(npages, pageSizes, pageCounts,
- startCell, cellCount, add);
+ startCell, cellCount,
+ lastCell, add);
}
static int
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
+ int lastCell,
bool add)
{
- int cell, lastCell;
+ int cell;
size_t i, ncounts = 0;
- if ((lastCell = virNumaGetMaxNode()) < 0)
- return 0;
-
if (startCell > lastCell) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("start cell %d out of range (0-%d)"),
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
+ int lastCell,
bool add);
unsigned int cellCount,
unsigned int flags)
{
+ struct _vboxDriver *driver = conn->privateData;
+ int lastCell;
bool add = !(flags & VIR_NODE_ALLOC_PAGES_SET);
virCheckFlags(VIR_NODE_ALLOC_PAGES_SET, -1);
+ virObjectLock(driver);
+ lastCell = virCapabilitiesHostNUMAGetMaxNode(driver->caps->host.numa);
+ virObjectUnlock(driver);
+
return virHostMemAllocPages(npages, pageSizes, pageCounts,
- startCell, cellCount, add);
+ startCell, cellCount, lastCell, add);
}
static int