ia64/xen-unstable

view tools/libxc/xenguest.h @ 7238:971e7c7411b3

Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception. Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:13:11 2005 +0100 (2005-10-06)
parents ef9591d03fdd
children 93e27f7ca8a8 61b3b357d827
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
16 /**
17 * This function will save a domain running Linux.
18 *
19 * @parm xc_handle a handle to an open hypervisor interface
20 * @parm fd the file descriptor to save a domain to
21 * @parm dom the id of the domain
22 * @return 0 on success, -1 on failure
23 */
24 int xc_linux_save(int xc_handle, int fd, uint32_t dom, uint32_t max_iters,
25 uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */);
27 /**
28 * This function will restore a saved domain running Linux.
29 *
30 * @parm xc_handle a handle to an open hypervisor interface
31 * @parm fd the file descriptor to restore a domain from
32 * @parm dom the id of the domain
33 * @parm nr_pfns the number of pages
34 * @parm store_evtchn the store event channel for this domain to use
35 * @parm store_mfn returned with the mfn of the store page
36 * @return 0 on success, -1 on failure
37 */
38 int xc_linux_restore(int xc_handle, int io_fd, uint32_t dom,
39 unsigned long nr_pfns, unsigned int store_evtchn,
40 unsigned long *store_mfn, unsigned int console_evtchn,
41 unsigned long *console_mfn);
43 int xc_linux_build(int xc_handle,
44 uint32_t domid,
45 const char *image_name,
46 const char *ramdisk_name,
47 const char *cmdline,
48 unsigned long flags,
49 unsigned int vcpus,
50 unsigned int store_evtchn,
51 unsigned long *store_mfn,
52 unsigned int console_evtchn,
53 unsigned long *console_mfn);
55 struct mem_map;
56 int xc_vmx_build(int xc_handle,
57 uint32_t domid,
58 int memsize,
59 const char *image_name,
60 unsigned int control_evtchn,
61 unsigned long flags,
62 unsigned int vcpus,
63 unsigned int store_evtchn,
64 unsigned long *store_mfn);
66 #endif // XENGUEST_H