xen_hypervisor.h 5.9 KB
Newer Older
1 2 3
/*
 * xen_internal.h: internal API for direct access to Xen hypervisor level
 *
4
 * Copyright (C) 2005, 2010-2011 Red Hat, Inc.
5 6 7 8 9 10 11
 *
 * See COPYING.LIB for the License of this software
 *
 * Daniel Veillard <veillard@redhat.com>
 */

#ifndef __VIR_XEN_INTERNAL_H__
12
# define __VIR_XEN_INTERNAL_H__
13

14 15 16
# include "internal.h"
# include "capabilities.h"
# include "driver.h"
M
Martin Kletzander 已提交
17
# include "viruri.h"
18

P
Philipp Hahn 已提交
19 20 21 22 23 24 25 26
/* 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 */
};

27
extern struct xenUnifiedDriver xenHypervisorDriver;
P
Philipp Hahn 已提交
28
int xenHypervisorInit(struct xenHypervisorVersions *override_versions);
29

30
virCapsPtr xenHypervisorMakeCapabilities (virConnectPtr conn);
31

32 33 34
int
        xenHypervisorHasDomain(virConnectPtr conn,
                               int id);
35 36
virDomainPtr
        xenHypervisorLookupDomainByID   (virConnectPtr conn,
37
                                         int id);
38
virDomainPtr
39 40
        xenHypervisorLookupDomainByUUID (virConnectPtr conn,
                                         const unsigned char *uuid);
41
char *
42
        xenHypervisorDomainGetOSType    (virDomainPtr dom);
43

44
virDrvOpenStatus
45
        xenHypervisorOpen               (virConnectPtr conn,
46
                                         virConnectAuthPtr auth,
47
                                         unsigned int flags);
48 49
int     xenHypervisorClose              (virConnectPtr conn);
int     xenHypervisorGetVersion         (virConnectPtr conn,
50
                                         unsigned long *hvVer);
51
virCapsPtr
52 53
        xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
                                              const char *hostmachine,
54 55
                                              FILE *cpuinfo,
                                              FILE *capabilities);
56 57
char *
        xenHypervisorGetCapabilities    (virConnectPtr conn);
58
unsigned long
59
        xenHypervisorGetDomMaxMemory    (virConnectPtr conn,
60
                                         int id);
61 62
int     xenHypervisorNumOfDomains       (virConnectPtr conn);
int     xenHypervisorListDomains        (virConnectPtr conn,
63 64
                                         int *ids,
                                         int maxids);
65 66
int     xenHypervisorGetMaxVcpus        (virConnectPtr conn,
                                         const char *type);
67 68
int     xenHypervisorDestroyDomain      (virDomainPtr domain)
          ATTRIBUTE_NONNULL (1);
69 70 71
int     xenHypervisorDestroyDomainFlags (virDomainPtr domain,
                                         unsigned int flags)
          ATTRIBUTE_NONNULL (1);
72 73 74 75
int     xenHypervisorResumeDomain       (virDomainPtr domain)
          ATTRIBUTE_NONNULL (1);
int     xenHypervisorPauseDomain        (virDomainPtr domain)
          ATTRIBUTE_NONNULL (1);
76
int     xenHypervisorGetDomainInfo        (virDomainPtr domain,
77 78
                                           virDomainInfoPtr info)
          ATTRIBUTE_NONNULL (1);
79 80 81 82 83
int     xenHypervisorGetDomainState     (virDomainPtr domain,
                                         int *state,
                                         int *reason,
                                         unsigned int flags)
          ATTRIBUTE_NONNULL (1);
84
int     xenHypervisorGetDomInfo         (virConnectPtr conn,
85 86
                                         int id,
                                         virDomainInfoPtr info);
87
int     xenHypervisorSetMaxMemory       (virDomainPtr domain,
88 89
                                         unsigned long memory)
          ATTRIBUTE_NONNULL (1);
90
int     xenHypervisorCheckID            (virConnectPtr conn,
91
                                         int id);
92
int     xenHypervisorSetVcpus           (virDomainPtr domain,
93 94
                                         unsigned int nvcpus)
          ATTRIBUTE_NONNULL (1);
95
int     xenHypervisorPinVcpu            (virDomainPtr domain,
96 97
                                         unsigned int vcpu,
                                         unsigned char *cpumap,
98 99
                                         int maplen)
          ATTRIBUTE_NONNULL (1);
100
int     xenHypervisorGetVcpus           (virDomainPtr domain,
101 102 103
                                         virVcpuInfoPtr info,
                                         int maxinfo,
                                         unsigned char *cpumaps,
104 105 106 107
                                         int maplen)
          ATTRIBUTE_NONNULL (1);
int     xenHypervisorGetVcpuMax         (virDomainPtr domain)
          ATTRIBUTE_NONNULL (1);
108

109
char *  xenHypervisorGetSchedulerType   (virDomainPtr domain,
110 111
                                         int *nparams)
          ATTRIBUTE_NONNULL (1);
112

113
int     xenHypervisorGetSchedulerParameters(virDomainPtr domain,
114
                                         virTypedParameterPtr params,
115 116
                                         int *nparams)
          ATTRIBUTE_NONNULL (1);
117

118
int     xenHypervisorSetSchedulerParameters(virDomainPtr domain,
119
                                         virTypedParameterPtr params,
120 121
                                         int nparams)
          ATTRIBUTE_NONNULL (1);
122

123
int     xenHypervisorDomainBlockStats   (virDomainPtr domain,
124
                                         const char *path,
125 126
                                         struct _virDomainBlockStats *stats)
          ATTRIBUTE_NONNULL (1);
127
int     xenHypervisorDomainInterfaceStats (virDomainPtr domain,
128
                                         const char *path,
129 130
                                         struct _virDomainInterfaceStats *stats)
          ATTRIBUTE_NONNULL (1);
131

132
int     xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
133 134 135
                                          unsigned long long *freeMems,
                                          int startCell,
                                          int maxCells);
136

J
John Levon 已提交
137 138
int	xenHavePrivilege(void);

139
#endif                          /* __VIR_XEN_INTERNAL_H__ */