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

#ifndef __VIR_XEN_INTERNAL_H__
#define __VIR_XEN_INTERNAL_H__

14 15
#include <libxml/uri.h>

16 17
#include "internal.h"
#include "capabilities.h"
18
#include "driver.h"
19

20
extern struct xenUnifiedDriver xenHypervisorDriver;
21
int    xenHypervisorInit                 (void);
22

23
virCapsPtr xenHypervisorMakeCapabilities (virConnectPtr conn);
24

25
/* The following calls are made directly by the Xen proxy: */
26 27 28
int
        xenHypervisorHasDomain(virConnectPtr conn,
                               int id);
29 30
virDomainPtr
        xenHypervisorLookupDomainByID   (virConnectPtr conn,
31
                                         int id);
32
virDomainPtr
33 34
        xenHypervisorLookupDomainByUUID (virConnectPtr conn,
                                         const unsigned char *uuid);
35
char *
36
        xenHypervisorDomainGetOSType    (virDomainPtr dom);
37

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

95
char *  xenHypervisorGetSchedulerType   (virDomainPtr domain,
96 97
                                         int *nparams)
          ATTRIBUTE_NONNULL (1);
98

99
int     xenHypervisorGetSchedulerParameters(virDomainPtr domain,
100
                                         virSchedParameterPtr params,
101 102
                                         int *nparams)
          ATTRIBUTE_NONNULL (1);
103

104
int     xenHypervisorSetSchedulerParameters(virDomainPtr domain,
105
                                         virSchedParameterPtr params,
106 107
                                         int nparams)
          ATTRIBUTE_NONNULL (1);
108

109
int     xenHypervisorDomainBlockStats   (virDomainPtr domain,
110
                                         const char *path,
111 112
                                         struct _virDomainBlockStats *stats)
          ATTRIBUTE_NONNULL (1);
113
int     xenHypervisorDomainInterfaceStats (virDomainPtr domain,
114
                                         const char *path,
115 116
                                         struct _virDomainInterfaceStats *stats)
          ATTRIBUTE_NONNULL (1);
117

118
int     xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
119 120 121
                                          unsigned long long *freeMems,
                                          int startCell,
                                          int maxCells);
122

J
John Levon 已提交
123 124
int	xenHavePrivilege(void);

125
#endif                          /* __VIR_XEN_INTERNAL_H__ */