nodeinfo.h 2.8 KB
Newer Older
1
/*
2
 * nodeinfo.h: Helper routines for OS specific node information
3
 *
4
 * Copyright (C) 2006-2008, 2011-2012 Red Hat, Inc.
5 6 7 8 9 10 11 12 13 14 15 16 17
 * 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
18
 * License along with this library.  If not, see
O
Osier Yang 已提交
19
 * <http://www.gnu.org/licenses/>.
20 21 22 23 24
 *
 * Author: Daniel P. Berrange <berrange@redhat.com>
 */

#ifndef __VIR_NODEINFO_H__
25
# define __VIR_NODEINFO_H__
26

27
# include "capabilities.h"
28

29
int nodeGetInfo(const char *sysfs_prefix, virNodeInfoPtr nodeinfo);
30
int nodeCapsInitNUMA(const char *sysfs_prefix, virCapsPtr caps);
31

32
int nodeGetCPUStats(int cpuNum,
33
                    virNodeCPUStatsPtr params,
34
                    int *nparams,
35
                    unsigned int flags);
36 37
int nodeGetMemoryStats(const char *sysfs_prefix,
                       int cellNum,
38
                       virNodeMemoryStatsPtr params,
39
                       int *nparams,
40
                       unsigned int flags);
41
int nodeGetCellsFreeMemory(unsigned long long *freeMems,
42 43
                           int startCell,
                           int maxCells);
44 45
int nodeGetMemory(unsigned long long *mem,
                  unsigned long long *freeMem);
46

47
virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
48
virBitmapPtr nodeGetOnlineCPUBitmap(const char *sysfs_prefix);
49
int nodeGetCPUCount(const char *sysfs_prefix);
50

51
int nodeGetMemoryParameters(virTypedParameterPtr params,
52 53 54
                            int *nparams,
                            unsigned int flags);

55
int nodeSetMemoryParameters(virTypedParameterPtr params,
56 57
                            int nparams,
                            unsigned int flags);
58

59 60
int nodeGetCPUMap(const char *sysfs_prefix,
                  unsigned char **cpumap,
61 62 63
                  unsigned int *online,
                  unsigned int flags);

64 65 66 67 68
int nodeGetFreePages(unsigned int npages,
                     unsigned int *pages,
                     int startCell,
                     unsigned int cellCount,
                     unsigned long long *counts);
69 70 71 72 73 74 75

int nodeAllocPages(unsigned int npages,
                   unsigned int *pageSizes,
                   unsigned long long *pageCounts,
                   int startCell,
                   unsigned int cellCount,
                   bool add);
76
#endif /* __VIR_NODEINFO_H__*/