ia64/xen-unstable

view tools/libxc/xenguest.h @ 19387:a5f497f02e34

Move the suspend event channel function to libxc, it will use the
/var/lib/xen/suspend_evtchn_lock.d to protect the access.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 18 11:49:26 2009 +0000 (2009-03-18)
parents 2a8ae362a828
children 205b1badbcfd
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)(void), 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);
133 int xc_hvm_build_target_mem(int xc_handle,
134 uint32_t domid,
135 int memsize,
136 int target,
137 const char *image_name);
139 int xc_hvm_build_mem(int xc_handle,
140 uint32_t domid,
141 int memsize,
142 const char *image_buffer,
143 unsigned long image_size);
145 int xc_suspend_evtchn_release(int xce, int suspend_evtchn);
147 int xc_suspend_evtchn_init(int xc, int xce, int domid, int port);
149 int xc_await_suspend(int xce, int suspend_evtchn);
151 #endif /* XENGUEST_H */