2005-12-07 18:10:51 +00:00
|
|
|
/*
|
|
|
|
* xen_internal.h: internal API for direct access to Xen hypervisor level
|
|
|
|
*
|
2011-05-26 17:39:04 +00:00
|
|
|
* Copyright (C) 2005, 2010-2011 Red Hat, Inc.
|
2005-12-07 18:10:51 +00:00
|
|
|
*
|
2012-07-27 09:39:53 +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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-27 09:39:53 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2005-12-07 18:10:51 +00:00
|
|
|
*
|
|
|
|
* Daniel Veillard <veillard@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_XEN_INTERNAL_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __VIR_XEN_INTERNAL_H__
|
2005-12-07 18:10:51 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "capabilities.h"
|
|
|
|
# include "driver.h"
|
2012-02-24 18:48:55 +00:00
|
|
|
# include "viruri.h"
|
2008-07-25 13:17:27 +00:00
|
|
|
|
2011-10-14 10:58:01 +00:00
|
|
|
/* See xenHypervisorInit() for details. */
|
|
|
|
struct xenHypervisorVersions {
|
|
|
|
int hv; /* u16 major,minor hypervisor version */
|
|
|
|
int hypervisor; /* -1,0,1,2,3 */
|
|
|
|
int sys_interface; /* -1,2,3,4,6,7,8 */
|
|
|
|
int dom_interface; /* -1,3,4,5,6,7 */
|
|
|
|
};
|
|
|
|
|
Fri Jul 6 16:08:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/proxy_internal.c, src/proxy_internal.h,
src.xen_internal.c, src/xen_internal.h,
src/xen_unified.c, src/xen_unified.h,
src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h,
src/xs_internal.c, src/xs_internal.h: The interface
between xen_unified.c and its underlying driver now uses
a custom structure (struct xenUnifiedDriver) instead
of reusing virDriver.
* src/xen_unified.c: virDomainLookup* functions in Xen
now throw VIR_ERR_NO_DOMAIN if the domain does not exist.
* src/xs_internal.c: Fix indentation.
2007-07-06 15:11:22 +00:00
|
|
|
extern struct xenUnifiedDriver xenHypervisorDriver;
|
2011-10-14 12:10:26 +00:00
|
|
|
int xenHypervisorInit(struct xenHypervisorVersions *override_versions);
|
2007-04-04 14:19:49 +00:00
|
|
|
|
2008-09-05 11:35:43 +00:00
|
|
|
virCapsPtr xenHypervisorMakeCapabilities (virConnectPtr conn);
|
2008-07-25 13:17:27 +00:00
|
|
|
|
2009-10-09 09:32:37 +00:00
|
|
|
int
|
|
|
|
xenHypervisorHasDomain(virConnectPtr conn,
|
|
|
|
int id);
|
2007-08-10 18:25:15 +00:00
|
|
|
virDomainPtr
|
|
|
|
xenHypervisorLookupDomainByID (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id);
|
2007-08-10 18:25:15 +00:00
|
|
|
virDomainPtr
|
2008-12-22 10:32:20 +00:00
|
|
|
xenHypervisorLookupDomainByUUID (virConnectPtr conn,
|
|
|
|
const unsigned char *uuid);
|
2007-08-10 18:25:15 +00:00
|
|
|
char *
|
2008-12-22 10:32:20 +00:00
|
|
|
xenHypervisorDomainGetOSType (virDomainPtr dom);
|
2007-08-10 18:25:15 +00:00
|
|
|
|
2008-12-17 21:26:16 +00:00
|
|
|
virDrvOpenStatus
|
2008-12-22 10:32:20 +00:00
|
|
|
xenHypervisorOpen (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
virConnectAuthPtr auth,
|
2011-07-06 20:40:19 +00:00
|
|
|
unsigned int flags);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorClose (virConnectPtr conn);
|
|
|
|
int xenHypervisorGetVersion (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned long *hvVer);
|
2008-07-25 13:17:27 +00:00
|
|
|
virCapsPtr
|
2008-09-05 11:35:43 +00:00
|
|
|
xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
|
2012-12-10 22:28:09 +00:00
|
|
|
virArch hostarch,
|
2008-07-25 13:17:27 +00:00
|
|
|
FILE *cpuinfo,
|
|
|
|
FILE *capabilities);
|
2007-03-15 17:24:56 +00:00
|
|
|
char *
|
|
|
|
xenHypervisorGetCapabilities (virConnectPtr conn);
|
2006-06-29 22:12:47 +00:00
|
|
|
unsigned long
|
2008-12-22 10:32:20 +00:00
|
|
|
xenHypervisorGetDomMaxMemory (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorNumOfDomains (virConnectPtr conn);
|
|
|
|
int xenHypervisorListDomains (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int *ids,
|
|
|
|
int maxids);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorGetMaxVcpus (virConnectPtr conn,
|
|
|
|
const char *type);
|
2010-01-27 12:34:03 +00:00
|
|
|
int xenHypervisorDestroyDomain (virDomainPtr domain)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2011-07-21 08:19:59 +00:00
|
|
|
int xenHypervisorDestroyDomainFlags (virDomainPtr domain,
|
|
|
|
unsigned int flags)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2010-01-27 12:34:03 +00:00
|
|
|
int xenHypervisorResumeDomain (virDomainPtr domain)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
|
|
|
int xenHypervisorPauseDomain (virDomainPtr domain)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorGetDomainInfo (virDomainPtr domain,
|
2010-01-27 12:34:03 +00:00
|
|
|
virDomainInfoPtr info)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2011-05-02 09:35:29 +00:00
|
|
|
int xenHypervisorGetDomainState (virDomainPtr domain,
|
|
|
|
int *state,
|
|
|
|
int *reason,
|
|
|
|
unsigned int flags)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorGetDomInfo (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id,
|
|
|
|
virDomainInfoPtr info);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorSetMaxMemory (virDomainPtr domain,
|
2010-01-27 12:34:03 +00:00
|
|
|
unsigned long memory)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorCheckID (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorSetVcpus (virDomainPtr domain,
|
2010-01-27 12:34:03 +00:00
|
|
|
unsigned int nvcpus)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorPinVcpu (virDomainPtr domain,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned int vcpu,
|
|
|
|
unsigned char *cpumap,
|
2010-01-27 12:34:03 +00:00
|
|
|
int maplen)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorGetVcpus (virDomainPtr domain,
|
2008-04-10 16:54:54 +00:00
|
|
|
virVcpuInfoPtr info,
|
|
|
|
int maxinfo,
|
|
|
|
unsigned char *cpumaps,
|
2010-01-27 12:34:03 +00:00
|
|
|
int maplen)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
|
|
|
int xenHypervisorGetVcpuMax (virDomainPtr domain)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2006-08-04 10:41:05 +00:00
|
|
|
|
2008-12-22 10:32:20 +00:00
|
|
|
char * xenHypervisorGetSchedulerType (virDomainPtr domain,
|
2010-01-27 12:34:03 +00:00
|
|
|
int *nparams)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2007-06-05 12:06:08 +00:00
|
|
|
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorGetSchedulerParameters(virDomainPtr domain,
|
2011-05-26 17:39:04 +00:00
|
|
|
virTypedParameterPtr params,
|
2010-01-27 12:34:03 +00:00
|
|
|
int *nparams)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2007-06-05 12:06:08 +00:00
|
|
|
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorSetSchedulerParameters(virDomainPtr domain,
|
2011-05-26 17:39:04 +00:00
|
|
|
virTypedParameterPtr params,
|
2010-01-27 12:34:03 +00:00
|
|
|
int nparams)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2007-06-05 12:06:08 +00:00
|
|
|
|
2007-08-21 10:08:12 +00:00
|
|
|
int xenHypervisorDomainBlockStats (virDomainPtr domain,
|
2008-04-10 16:54:54 +00:00
|
|
|
const char *path,
|
2010-01-27 12:34:03 +00:00
|
|
|
struct _virDomainBlockStats *stats)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2007-08-21 10:08:12 +00:00
|
|
|
int xenHypervisorDomainInterfaceStats (virDomainPtr domain,
|
2008-04-10 16:54:54 +00:00
|
|
|
const char *path,
|
2010-01-27 12:34:03 +00:00
|
|
|
struct _virDomainInterfaceStats *stats)
|
|
|
|
ATTRIBUTE_NONNULL (1);
|
2007-08-21 10:08:12 +00:00
|
|
|
|
2008-12-22 10:32:20 +00:00
|
|
|
int xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned long long *freeMems,
|
|
|
|
int startCell,
|
|
|
|
int maxCells);
|
2008-08-20 20:48:35 +00:00
|
|
|
|
2009-01-22 17:49:41 +00:00
|
|
|
int xenHavePrivilege(void);
|
|
|
|
|
2006-03-15 12:13:25 +00:00
|
|
|
#endif /* __VIR_XEN_INTERNAL_H__ */
|