direct-io.hg

annotate tools/libxc/xc.h @ 3451:90f0ae7be1de

bitkeeper revision 1.1159.222.1 (41ebdd9btvi-aV_bkwfCgKSenC9XbQ)

Add an optional parameter (vcpus) to the xc_linux_build function replacing
the getenv() previously used and removing the requirement of using maxcpus
kernel parameter to limit the number of virtual cpus a guest uses. The value
can now be controlled in the domain configuration files.

The default value of 1 is set in XenDomainInfo.py but is overridden by
parsing the config value.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
author cl349@arcadians.cl.cam.ac.uk
date Mon Jan 17 15:45:31 2005 +0000 (2005-01-17)
parents 2afa7aa0076f
children 707455ee2ff6
rev   line source
mjw@1623 1 /******************************************************************************
mjw@1623 2 * xc.h
mjw@1623 3 *
mjw@1623 4 * A library for low-level access to the Xen control interfaces.
mjw@1623 5 *
kaf24@2787 6 * Copyright (c) 2003-2004, K A Fraser.
mjw@1623 7 */
mjw@1623 8
mjw@1623 9 #ifndef __XC_H__
mjw@1623 10 #define __XC_H__
mjw@1623 11
kaf24@3266 12 #include <stdint.h>
iap10@3390 13 #include "linux_boot_params.h"
iap10@3390 14
kaf24@3266 15 typedef uint8_t u8;
kaf24@3266 16 typedef uint16_t u16;
kaf24@3266 17 typedef uint32_t u32;
kaf24@3266 18 typedef uint64_t u64;
kaf24@3266 19 typedef int8_t s8;
kaf24@3266 20 typedef int16_t s16;
kaf24@3266 21 typedef int32_t s32;
kaf24@3266 22 typedef int64_t s64;
mjw@1623 23
kaf24@2821 24 #include <xen/xen.h>
kaf24@2821 25 #include <xen/dom0_ops.h>
kaf24@2821 26 #include <xen/event_channel.h>
kaf24@2821 27 #include <xen/sched_ctl.h>
kaf24@2821 28 #include <xen/io/domain_controller.h>
kaf24@2787 29
mjw@1623 30 /* Obtain or relinquish a handle on the 'xc' library. */
mjw@1623 31 int xc_interface_open(void);
mjw@1623 32 int xc_interface_close(int xc_handle);
mjw@1623 33
mjw@1623 34 typedef struct {
mjw@1623 35 u32 domid;
mjw@1623 36 unsigned int cpu;
mjw@1623 37 unsigned int dying:1, crashed:1, shutdown:1,
mjw@1623 38 paused:1, blocked:1, running:1;
mjw@1623 39 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
mjw@1623 40 unsigned long nr_pages;
mjw@1623 41 unsigned long shared_info_frame;
mjw@1623 42 u64 cpu_time;
mjw@1623 43 unsigned long max_memkb;
mjw@1623 44 } xc_dominfo_t;
mjw@1623 45
kaf24@2787 46 typedef dom0_getdomaininfo_t xc_domaininfo_t;
mjw@1623 47 int xc_domain_create(int xc_handle,
mjw@1623 48 unsigned int mem_kb,
mjw@1623 49 int cpu,
gm281@2236 50 float cpu_weight,
mjw@1623 51 u32 *pdomid);
mjw@1623 52 int xc_domain_pause(int xc_handle,
mjw@1623 53 u32 domid);
mjw@1623 54 int xc_domain_unpause(int xc_handle,
mjw@1623 55 u32 domid);
mjw@1623 56 int xc_domain_destroy(int xc_handle,
mjw@1623 57 u32 domid);
mjw@1623 58 int xc_domain_pincpu(int xc_handle,
mjw@1623 59 u32 domid,
mjw@1623 60 int cpu);
mjw@1623 61 int xc_domain_getinfo(int xc_handle,
mjw@1623 62 u32 first_domid,
mjw@1623 63 unsigned int max_doms,
mjw@1623 64 xc_dominfo_t *info);
kaf24@2787 65 int xc_domain_getfullinfo(int xc_handle,
kaf24@2787 66 u32 domid,
kaf24@2787 67 xc_domaininfo_t *info,
kaf24@2787 68 full_execution_context_t *ctxt);
gm281@2236 69 int xc_domain_setcpuweight(int xc_handle,
gm281@2236 70 u32 domid,
gm281@2236 71 float weight);
kaf24@2787 72 long long xc_domain_get_cpu_usage(int xc_handle,
kaf24@2787 73 domid_t domid);
mjw@1623 74
kaf24@2787 75
kaf24@2787 76 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
mjw@1623 77 int xc_shadow_control(int xc_handle,
mjw@1623 78 u32 domid,
mjw@1623 79 unsigned int sop,
mjw@1623 80 unsigned long *dirty_bitmap,
mjw@1623 81 unsigned long pages,
mjw@1623 82 xc_shadow_control_stats_t *stats);
mjw@1623 83
mjw@1623 84
mjw@2574 85 #define XCFLAGS_VERBOSE 1
mjw@2574 86 #define XCFLAGS_LIVE 2
mjw@2574 87 #define XCFLAGS_DEBUG 4
mjw@2574 88 #define XCFLAGS_CONFIGURE 8
mjw@1623 89
mjw@1623 90 struct XcIOContext;
mjw@1623 91 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
mjw@1623 92 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
mjw@1623 93
mjw@1623 94 int xc_linux_build(int xc_handle,
mjw@1623 95 u32 domid,
mjw@1623 96 const char *image_name,
mjw@1623 97 const char *ramdisk_name,
mjw@1623 98 const char *cmdline,
mjw@1623 99 unsigned int control_evtchn,
cl349@3451 100 unsigned long flags,
cl349@3451 101 unsigned int vcpus);
mjw@1623 102
iap10@3326 103 int
iap10@3326 104 xc_plan9_build (int xc_handle,
iap10@3326 105 u32 domid,
iap10@3326 106 const char *image_name,
iap10@3326 107 const char *cmdline,
iap10@3326 108 unsigned int control_evtchn,
iap10@3326 109 unsigned long flags);
iap10@3326 110
iap10@3390 111 int xc_vmx_build(int xc_handle,
iap10@3390 112 u32 domid,
iap10@3390 113 const char *image_name,
iap10@3390 114 struct mem_map *memmap,
iap10@3390 115 const char *ramdisk_name,
iap10@3390 116 const char *cmdline,
iap10@3390 117 unsigned int control_evtchn,
iap10@3390 118 unsigned long flags);
iap10@3390 119
mjw@1623 120 int xc_bvtsched_global_set(int xc_handle,
mjw@1623 121 unsigned long ctx_allow);
mjw@1623 122
mjw@1623 123 int xc_bvtsched_domain_set(int xc_handle,
mjw@1623 124 u32 domid,
gm281@2058 125 u32 mcuadv,
gm281@2058 126 int warpback,
gm281@2058 127 s32 warpvalue,
gm281@2058 128 long long warpl,
gm281@2058 129 long long warpu);
mjw@1623 130
mjw@1623 131 int xc_bvtsched_global_get(int xc_handle,
mjw@1623 132 unsigned long *ctx_allow);
mjw@1623 133
mjw@1623 134 int xc_bvtsched_domain_get(int xc_handle,
mjw@1623 135 u32 domid,
gm281@2058 136 u32 *mcuadv,
gm281@2058 137 int *warpback,
gm281@2058 138 s32 *warpvalue,
gm281@2058 139 long long *warpl,
gm281@2058 140 long long *warpu);
mjw@1623 141
mjw@1623 142 int xc_atropos_domain_set(int xc_handle,
mjw@1623 143 u32 domid,
mjw@1623 144 u64 period, u64 slice, u64 latency,
mjw@1623 145 int xtratime);
mjw@1623 146
mjw@1623 147 int xc_atropos_domain_get(int xc_handle,
mjw@1623 148 u32 domid,
mjw@1623 149 u64* period, u64 *slice, u64 *latency,
mjw@1623 150 int *xtratime);
mjw@1623 151
mjw@1623 152 int xc_rrobin_global_set(int xc_handle, u64 slice);
mjw@1623 153
mjw@1623 154 int xc_rrobin_global_get(int xc_handle, u64 *slice);
mjw@1623 155
kaf24@2787 156 typedef evtchn_status_t xc_evtchn_status_t;
kaf24@2713 157 int xc_evtchn_alloc_unbound(int xc_handle,
kaf24@2713 158 u32 dom,
kaf24@2713 159 int *port);
mjw@1623 160 int xc_evtchn_bind_interdomain(int xc_handle,
mjw@1623 161 u32 dom1, /* may be DOMID_SELF */
mjw@1623 162 u32 dom2, /* may be DOMID_SELF */
mjw@1623 163 int *port1,
mjw@1623 164 int *port2);
mjw@1623 165 int xc_evtchn_bind_virq(int xc_handle,
mjw@1623 166 int virq,
mjw@1623 167 int *port);
mjw@1623 168 int xc_evtchn_close(int xc_handle,
mjw@1623 169 u32 dom, /* may be DOMID_SELF */
mjw@1623 170 int port);
mjw@1623 171 int xc_evtchn_send(int xc_handle,
mjw@1623 172 int local_port);
mjw@1623 173 int xc_evtchn_status(int xc_handle,
mjw@1623 174 u32 dom, /* may be DOMID_SELF */
mjw@1623 175 int port,
mjw@1623 176 xc_evtchn_status_t *status);
mjw@1623 177
mjw@1623 178 int xc_physdev_pci_access_modify(int xc_handle,
mjw@1623 179 u32 domid,
mjw@1623 180 int bus,
mjw@1623 181 int dev,
mjw@1623 182 int func,
mjw@1623 183 int enable);
mjw@1623 184
mjw@1623 185 int xc_readconsolering(int xc_handle,
mjw@1623 186 char *str,
mjw@1623 187 unsigned int max_chars,
mjw@1623 188 int clear);
mjw@1623 189
kaf24@2787 190 typedef dom0_physinfo_t xc_physinfo_t;
mjw@1623 191 int xc_physinfo(int xc_handle,
mjw@1623 192 xc_physinfo_t *info);
mjw@1623 193
gm281@2236 194 int xc_sched_id(int xc_handle,
gm281@2236 195 int *sched_id);
gm281@2236 196
mjw@1623 197 int xc_domain_setinitialmem(int xc_handle,
mjw@1623 198 u32 domid,
mjw@1623 199 unsigned int initial_memkb);
mjw@1623 200
mjw@1623 201 int xc_domain_setmaxmem(int xc_handle,
kaf24@3231 202 u32 domid,
kaf24@3231 203 unsigned int max_memkb);
mjw@1623 204
cl349@2449 205 int xc_domain_setvmassist(int xc_handle,
cl349@2449 206 u32 domid,
cl349@2449 207 unsigned int cmd,
cl349@2449 208 unsigned int type);
cl349@2449 209
kaf24@3231 210 typedef dom0_perfc_desc_t xc_perfc_desc_t;
kaf24@3231 211 /* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
kaf24@3231 212 int xc_perfc_control(int xc_handle,
kaf24@3231 213 u32 op,
kaf24@3231 214 xc_perfc_desc_t *desc);
mjw@1623 215
iap10@2325 216 void *xc_map_foreign_range(int xc_handle, u32 dom,
iap10@2325 217 int size, int prot,
iap10@2325 218 unsigned long mfn );
iap10@2325 219
iap10@2325 220 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
iap10@2325 221 unsigned long *arr, int num );
iap10@2325 222
iap10@3390 223 int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
iap10@3390 224 unsigned long max_pfns);
iap10@3390 225
mjw@1623 226 #endif /* __XC_H__ */