2014-06-06 14:50:39 +00:00
|
|
|
/*
|
2015-02-11 09:08:35 +00:00
|
|
|
* numa_conf.h
|
2014-06-06 14:50:39 +00:00
|
|
|
*
|
2015-02-11 09:08:35 +00:00
|
|
|
* Copyright (C) 2014-2015 Red Hat, Inc.
|
2014-06-06 14:50:39 +00:00
|
|
|
*
|
|
|
|
* 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: Martin Kletzander <mkletzan@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2015-02-11 09:08:35 +00:00
|
|
|
#ifndef __NUMA_CONF_H__
|
|
|
|
# define __NUMA_CONF_H__
|
2014-06-06 14:50:39 +00:00
|
|
|
|
2014-06-09 13:00:22 +00:00
|
|
|
# include <libxml/xpath.h>
|
|
|
|
|
2014-06-06 14:50:39 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "virutil.h"
|
|
|
|
# include "virbitmap.h"
|
2014-06-09 13:00:22 +00:00
|
|
|
# include "virbuffer.h"
|
|
|
|
|
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
typedef struct _virDomainNuma virDomainNuma;
|
|
|
|
typedef virDomainNuma *virDomainNumaPtr;
|
2014-06-06 14:50:39 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2014-06-08 17:15:42 +00:00
|
|
|
VIR_DOMAIN_NUMATUNE_PLACEMENT_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC,
|
|
|
|
VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO,
|
2014-06-06 14:50:39 +00:00
|
|
|
|
2014-06-08 17:15:42 +00:00
|
|
|
VIR_DOMAIN_NUMATUNE_PLACEMENT_LAST
|
|
|
|
} virDomainNumatunePlacement;
|
2014-06-06 14:50:39 +00:00
|
|
|
|
2014-06-08 17:15:42 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNumatunePlacement)
|
2014-06-06 14:50:39 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNumatuneMemMode)
|
|
|
|
|
2015-02-11 14:40:27 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_NUMA_MEM_ACCESS_DEFAULT,
|
|
|
|
VIR_NUMA_MEM_ACCESS_SHARED,
|
|
|
|
VIR_NUMA_MEM_ACCESS_PRIVATE,
|
|
|
|
|
|
|
|
VIR_NUMA_MEM_ACCESS_LAST
|
|
|
|
} virNumaMemAccess;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virNumaMemAccess)
|
2014-06-09 13:00:22 +00:00
|
|
|
|
2015-02-16 15:42:13 +00:00
|
|
|
virDomainNumaPtr virDomainNumaNew(void);
|
2015-02-11 13:54:59 +00:00
|
|
|
void virDomainNumaFree(virDomainNumaPtr numa);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* XML Parse/Format functions
|
|
|
|
*/
|
2015-02-16 16:19:15 +00:00
|
|
|
int virDomainNumatuneParseXML(virDomainNumaPtr numa,
|
2014-07-21 09:32:33 +00:00
|
|
|
bool placement_static,
|
|
|
|
xmlXPathContextPtr ctxt)
|
2015-02-16 16:28:48 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
int virDomainNumatuneFormatXML(virBufferPtr buf, virDomainNumaPtr numatune)
|
2014-06-09 13:00:22 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Getters
|
|
|
|
*/
|
2015-02-11 13:54:59 +00:00
|
|
|
virDomainNumatuneMemMode virDomainNumatuneGetMode(virDomainNumaPtr numatune,
|
2014-06-26 17:46:45 +00:00
|
|
|
int cellid);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
virBitmapPtr virDomainNumatuneGetNodeset(virDomainNumaPtr numatune,
|
2014-06-26 17:46:45 +00:00
|
|
|
virBitmapPtr auto_nodeset,
|
|
|
|
int cellid);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
|
2015-01-15 21:40:15 +00:00
|
|
|
virBitmapPtr auto_nodeset,
|
|
|
|
virBitmapPtr *retNodeset,
|
|
|
|
int cellid);
|
|
|
|
|
2015-02-16 16:28:48 +00:00
|
|
|
size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa)
|
2015-02-16 17:11:46 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2015-02-16 16:28:48 +00:00
|
|
|
virBitmapPtr virDomainNumaGetNodeCpumask(virDomainNumaPtr numa,
|
2015-02-16 17:38:43 +00:00
|
|
|
size_t node)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
2015-02-16 16:28:48 +00:00
|
|
|
virNumaMemAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa,
|
2015-02-16 17:51:36 +00:00
|
|
|
size_t node)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
2015-02-16 16:28:48 +00:00
|
|
|
unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
|
2015-02-16 18:14:23 +00:00
|
|
|
size_t node)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
2015-02-16 19:15:04 +00:00
|
|
|
unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
2015-02-16 17:11:46 +00:00
|
|
|
|
2014-06-09 13:00:22 +00:00
|
|
|
/*
|
|
|
|
* Formatters
|
|
|
|
*/
|
2015-02-11 13:54:59 +00:00
|
|
|
char *virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune,
|
2014-06-26 17:46:45 +00:00
|
|
|
virBitmapPtr auto_nodeset,
|
|
|
|
int cellid);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
int virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune,
|
2014-06-09 13:00:22 +00:00
|
|
|
virBitmapPtr auto_nodeset,
|
2014-06-26 17:46:45 +00:00
|
|
|
char **mask,
|
|
|
|
int cellid);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Setters
|
|
|
|
*/
|
2015-02-16 16:05:46 +00:00
|
|
|
int virDomainNumatuneSet(virDomainNumaPtr numa,
|
2014-07-21 09:32:33 +00:00
|
|
|
bool placement_static,
|
|
|
|
int placement,
|
|
|
|
int mode,
|
|
|
|
virBitmapPtr nodeset)
|
2014-06-09 13:00:22 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2015-02-16 16:28:48 +00:00
|
|
|
void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
|
2015-02-16 18:14:23 +00:00
|
|
|
size_t node,
|
|
|
|
unsigned long long size)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2014-06-09 13:00:22 +00:00
|
|
|
/*
|
|
|
|
* Other accessors
|
|
|
|
*/
|
2015-02-11 13:54:59 +00:00
|
|
|
bool virDomainNumaEquals(virDomainNumaPtr n1,
|
|
|
|
virDomainNumaPtr n2);
|
2014-06-09 13:00:22 +00:00
|
|
|
|
2015-02-16 19:34:37 +00:00
|
|
|
bool virDomainNumaCheckABIStability(virDomainNumaPtr src,
|
|
|
|
virDomainNumaPtr tgt);
|
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune);
|
2014-06-06 14:50:39 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune);
|
2014-06-26 17:46:45 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
int virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune);
|
2014-11-06 11:16:54 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
bool virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune,
|
2014-11-06 11:16:54 +00:00
|
|
|
virBitmapPtr auto_nodeset);
|
2015-02-12 16:37:46 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
bool virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune,
|
2015-02-12 16:37:46 +00:00
|
|
|
int cellid);
|
2015-02-11 11:27:53 +00:00
|
|
|
|
2015-02-16 16:28:48 +00:00
|
|
|
int virDomainNumaDefCPUParseXML(virDomainNumaPtr def, xmlXPathContextPtr ctxt);
|
|
|
|
int virDomainNumaDefCPUFormat(virBufferPtr buf, virDomainNumaPtr def);
|
2015-02-11 11:27:53 +00:00
|
|
|
|
2015-02-16 16:28:48 +00:00
|
|
|
unsigned int virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa);
|
2015-02-12 08:37:13 +00:00
|
|
|
|
|
|
|
|
2015-02-11 09:08:35 +00:00
|
|
|
#endif /* __NUMA_CONF_H__ */
|