direct-io.hg

view tools/libxc/xenguest.h @ 15534:da4c76340184

NativeDom 1:1 support for x86_64, 32bitbios reloc bug fix
author Guy Zana <guy@neocleus.com>
date Wed Sep 19 10:51:46 2007 +0200 (2007-09-19)
parents 13483c74ce04
children
line source
1 /******************************************************************************
2 * xenguest.h
3 *
4 * A library for guest domain management in Xen.
5 *
6 * Copyright (c) 2003-2004, K A Fraser.
7 */
9 #ifndef XENGUEST_H
10 #define XENGUEST_H
12 #define XCFLAGS_LIVE 1
13 #define XCFLAGS_DEBUG 2
14 #define XCFLAGS_HVM 4
15 #define XCFLAGS_STDVGA 8
18 /**
19 * This function will save a running domain.
20 *
21 * @parm xc_handle a handle to an open hypervisor interface
22 * @parm fd the file descriptor to save a domain to
23 * @parm dom the id of the domain
24 * @return 0 on success, -1 on failure
25 */
26 int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
27 uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
28 int (*suspend)(int domid), int hvm,
29 void *(*init_qemu_maps)(int, unsigned), /* HVM only */
30 void (*qemu_flip_buffer)(int, int)); /* HVM only */
33 /**
34 * This function will restore a saved domain.
35 *
36 * @parm xc_handle a handle to an open hypervisor interface
37 * @parm fd the file descriptor to restore a domain from
38 * @parm dom the id of the domain
39 * @parm store_evtchn the store event channel for this domain to use
40 * @parm store_mfn returned with the mfn of the store page
41 * @parm hvm non-zero if this is a HVM restore
42 * @parm pae non-zero if this HVM domain has PAE support enabled
43 * @return 0 on success, -1 on failure
44 */
45 int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
46 unsigned int store_evtchn, unsigned long *store_mfn,
47 unsigned int console_evtchn, unsigned long *console_mfn,
48 unsigned int hvm, unsigned int pae);
50 /**
51 * This function will create a domain for a paravirtualized Linux
52 * using file names pointing to kernel and ramdisk
53 *
54 * @parm xc_handle a handle to an open hypervisor interface
55 * @parm domid the id of the domain
56 * @parm mem_mb memory size in megabytes
57 * @parm image_name name of the kernel image file
58 * @parm ramdisk_name name of the ramdisk image file
59 * @parm cmdline command line string
60 * @parm flags domain creation flags
61 * @parm store_evtchn the store event channel for this domain to use
62 * @parm store_mfn returned with the mfn of the store page
63 * @parm console_evtchn the console event channel for this domain to use
64 * @parm conole_mfn returned with the mfn of the console page
65 * @return 0 on success, -1 on failure
66 */
67 int xc_linux_build(int xc_handle,
68 uint32_t domid,
69 unsigned int mem_mb,
70 const char *image_name,
71 const char *ramdisk_name,
72 const char *cmdline,
73 const char *features,
74 unsigned long flags,
75 unsigned int store_evtchn,
76 unsigned long *store_mfn,
77 unsigned int console_evtchn,
78 unsigned long *console_mfn);
80 /** The same interface, but the dom structure is managed by the caller */
81 struct xc_dom_image;
82 int xc_dom_linux_build(int xc_handle,
83 struct xc_dom_image *dom,
84 uint32_t domid,
85 unsigned int mem_mb,
86 const char *image_name,
87 const char *ramdisk_name,
88 unsigned long flags,
89 unsigned int store_evtchn,
90 unsigned long *store_mfn,
91 unsigned int console_evtchn,
92 unsigned long *console_mfn);
94 /**
95 * This function will create a domain for a paravirtualized Linux
96 * using buffers for kernel and initrd
97 *
98 * @parm xc_handle a handle to an open hypervisor interface
99 * @parm domid the id of the domain
100 * @parm mem_mb memory size in megabytes
101 * @parm image_buffer buffer containing kernel image
102 * @parm image_size size of the kernel image buffer
103 * @parm initrd_buffer name of the ramdisk image file
104 * @parm initrd_size size of the ramdisk buffer
105 * @parm cmdline command line string
106 * @parm flags domain creation flags
107 * @parm store_evtchn the store event channel for this domain to use
108 * @parm store_mfn returned with the mfn of the store page
109 * @parm console_evtchn the console event channel for this domain to use
110 * @parm conole_mfn returned with the mfn of the console page
111 * @return 0 on success, -1 on failure
112 */
113 int xc_linux_build_mem(int xc_handle,
114 uint32_t domid,
115 unsigned int mem_mb,
116 const char *image_buffer,
117 unsigned long image_size,
118 const char *initrd_buffer,
119 unsigned long initrd_size,
120 const char *cmdline,
121 const char *features,
122 unsigned long flags,
123 unsigned int store_evtchn,
124 unsigned long *store_mfn,
125 unsigned int console_evtchn,
126 unsigned long *console_mfn);
128 int xc_hvm_build(int xc_handle,
129 uint32_t domid,
130 int memsize,
131 const char *image_name,
132 int is_nativedom);
134 int xc_hvm_build_mem(int xc_handle,
135 uint32_t domid,
136 int memsize,
137 const char *image_buffer,
138 unsigned long image_size,
139 int is_nativedom);
141 /* NativeDom support */
142 int xc_is_nativedom_enabled(int xc_handle);
143 int xc_get_nativedom_last_mfn(int xc_handle);
144 int xc_build_nativedom_e820map(int handle, uint32_t dom);
146 /* PowerPC specific. */
147 int xc_prose_build(int xc_handle,
148 uint32_t domid,
149 unsigned int mem_mb,
150 const char *image_name,
151 const char *ramdisk_name,
152 const char *cmdline,
153 const char *features,
154 unsigned long flags,
155 unsigned int store_evtchn,
156 unsigned long *store_mfn,
157 unsigned int console_evtchn,
158 unsigned long *console_mfn);
160 #endif /* XENGUEST_H */