nodeinfo.h 2.7 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
int nodeGetMemoryStats(int cellNum,
37
                       virNodeMemoryStatsPtr params,
38
                       int *nparams,
39
                       unsigned int flags);
40
int nodeGetCellsFreeMemory(unsigned long long *freeMems,
41 42
                           int startCell,
                           int maxCells);
43 44
int nodeGetMemory(unsigned long long *mem,
                  unsigned long long *freeMem);
45

46
virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
47
virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix, int *max_id);
48
int nodeGetCPUCount(const char *sysfs_prefix);
49

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

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

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

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

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