提交 86dd9fac 编写于 作者: D Daniel P. Berrange

nodeinfo: move host memory APIs out into virhostmem file

Move all APIs with a virHostMEM name prefix out into new
util/virhostmem.h & util/virhostmem.c files
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 eaf18f4c
...@@ -198,6 +198,7 @@ src/util/virhash.c ...@@ -198,6 +198,7 @@ src/util/virhash.c
src/util/virhook.c src/util/virhook.c
src/util/virhostcpu.c src/util/virhostcpu.c
src/util/virhostdev.c src/util/virhostdev.c
src/util/virhostmem.c
src/util/viridentity.c src/util/viridentity.c
src/util/virinitctl.c src/util/virinitctl.c
src/util/viriptables.c src/util/viriptables.c
......
...@@ -121,6 +121,7 @@ UTIL_SOURCES = \ ...@@ -121,6 +121,7 @@ UTIL_SOURCES = \
util/virhook.c util/virhook.h \ util/virhook.c util/virhook.h \
util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \ util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \
util/virhostdev.c util/virhostdev.h \ util/virhostdev.c util/virhostdev.h \
util/virhostmem.c util/virhostmem.h \
util/viridentity.c util/viridentity.h \ util/viridentity.c util/viridentity.h \
util/virinitctl.c util/virinitctl.h \ util/virinitctl.c util/virinitctl.h \
util/viriptables.c util/viriptables.h \ util/viriptables.c util/viriptables.h \
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include "virnetdevopenvswitch.h" #include "virnetdevopenvswitch.h"
#include "nodeinfo.h" #include "nodeinfo.h"
#include "virhostcpu.h" #include "virhostcpu.h"
#include "virhostmem.h"
#include "viruuid.h" #include "viruuid.h"
#include "virstats.h" #include "virstats.h"
#include "virhook.h" #include "virhook.h"
......
此差异已折叠。
...@@ -29,35 +29,4 @@ ...@@ -29,35 +29,4 @@
int nodeGetInfo(virNodeInfoPtr nodeinfo); int nodeGetInfo(virNodeInfoPtr nodeinfo);
int nodeCapsInitNUMA(virCapsPtr caps); int nodeCapsInitNUMA(virCapsPtr caps);
int virHostMemGetStats(int cellNum,
virNodeMemoryStatsPtr params,
int *nparams,
unsigned int flags);
int virHostMemGetCellsFree(unsigned long long *freeMems,
int startCell,
int maxCells);
int virHostMemGetInfo(unsigned long long *mem,
unsigned long long *freeMem);
int virHostMemGetParameters(virTypedParameterPtr params,
int *nparams,
unsigned int flags);
int virHostMemSetParameters(virTypedParameterPtr params,
int nparams,
unsigned int flags);
int virHostMemGetFreePages(unsigned int npages,
unsigned int *pages,
int startCell,
unsigned int cellCount,
unsigned long long *counts);
int virHostMemAllocPages(unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
bool add);
#endif /* __VIR_NODEINFO_H__*/ #endif /* __VIR_NODEINFO_H__*/
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "openvz_conf.h" #include "openvz_conf.h"
#include "nodeinfo.h" #include "nodeinfo.h"
#include "virhostcpu.h" #include "virhostcpu.h"
#include "virhostmem.h"
#include "viralloc.h" #include "viralloc.h"
#include "virfile.h" #include "virfile.h"
#include "virtypedparam.h" #include "virtypedparam.h"
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "virbuffer.h" #include "virbuffer.h"
#include "nodeinfo.h" #include "nodeinfo.h"
#include "virhostcpu.h" #include "virhostcpu.h"
#include "virhostmem.h"
#include "virstats.h" #include "virstats.h"
#include "capabilities.h" #include "capabilities.h"
#include "viralloc.h" #include "viralloc.h"
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "virbuffer.h" #include "virbuffer.h"
#include "nodeinfo.h" #include "nodeinfo.h"
#include "virhostcpu.h" #include "virhostcpu.h"
#include "virhostmem.h"
#include "virstats.h" #include "virstats.h"
#include "capabilities.h" #include "capabilities.h"
#include "viralloc.h" #include "viralloc.h"
......
此差异已折叠。
/*
* virhostmem.h: helper APIs for host memory info
*
* Copyright (C) 2006-2016 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Daniel P. Berrange <berrange@redhat.com>
*/
#ifndef __VIR_HOSTMEM_H__
# define __VIR_HOSTMEM_H__
# include "internal.h"
int virHostMemGetStats(int cellNum,
virNodeMemoryStatsPtr params,
int *nparams,
unsigned int flags);
int virHostMemGetCellsFree(unsigned long long *freeMems,
int startCell,
int maxCells);
int virHostMemGetInfo(unsigned long long *mem,
unsigned long long *freeMem);
int virHostMemGetParameters(virTypedParameterPtr params,
int *nparams,
unsigned int flags);
int virHostMemSetParameters(virTypedParameterPtr params,
int nparams,
unsigned int flags);
int virHostMemGetFreePages(unsigned int npages,
unsigned int *pages,
int startCell,
unsigned int cellCount,
unsigned long long *counts);
int virHostMemAllocPages(unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
bool add);
#endif /* __VIR_HOSTMEM_H__*/
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "virbitmap.h" #include "virbitmap.h"
#include "virstring.h" #include "virstring.h"
#include "virfile.h" #include "virfile.h"
#include "nodeinfo.h" #include "virhostmem.h"
#define VIR_FROM_THIS VIR_FROM_NONE #define VIR_FROM_THIS VIR_FROM_NONE
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "virlog.h" #include "virlog.h"
#include "viralloc.h" #include "viralloc.h"
#include "nodeinfo.h" #include "nodeinfo.h"
#include "virhostmem.h"
#include "virstring.h" #include "virstring.h"
#include "virfile.h" #include "virfile.h"
#include "virtime.h" #include "virtime.h"
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include "vircommand.h" #include "vircommand.h"
#include "virnodesuspend.h" #include "virnodesuspend.h"
#include "nodeinfo.h" #include "nodeinfo.h"
#include "virhostmem.h"
#include "configmake.h" #include "configmake.h"
#include "virstring.h" #include "virstring.h"
#include "viraccessapicheck.h" #include "viraccessapicheck.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册