ia64/xen-unstable

view tools/libxen/include/xen_crashdump.h @ 14045:7819d9332fba

Split the VBD I/O statistics out into a VBD_metrics class. Document the
VBD.type field, and add it to the C bindings (this was already in Xend).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 20 21:28:19 2007 +0000 (2007-02-20)
parents 69c5afd5ab08
children dfaca81ededb
line source
1 /*
2 * Copyright (c) 2006, XenSource Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
19 #ifndef XEN_CRASHDUMP_H
20 #define XEN_CRASHDUMP_H
22 #include "xen_common.h"
23 #include "xen_crashdump_decl.h"
24 #include "xen_vdi_decl.h"
25 #include "xen_vm_decl.h"
28 /*
29 * The crashdump class.
30 *
31 * A VM crashdump.
32 */
35 /**
36 * Free the given xen_crashdump. The given handle must have been
37 * allocated by this library.
38 */
39 extern void
40 xen_crashdump_free(xen_crashdump crashdump);
43 typedef struct xen_crashdump_set
44 {
45 size_t size;
46 xen_crashdump *contents[];
47 } xen_crashdump_set;
49 /**
50 * Allocate a xen_crashdump_set of the given size.
51 */
52 extern xen_crashdump_set *
53 xen_crashdump_set_alloc(size_t size);
55 /**
56 * Free the given xen_crashdump_set. The given set must have been
57 * allocated by this library.
58 */
59 extern void
60 xen_crashdump_set_free(xen_crashdump_set *set);
63 typedef struct xen_crashdump_record
64 {
65 xen_crashdump handle;
66 char *uuid;
67 struct xen_vm_record_opt *vm;
68 struct xen_vdi_record_opt *vdi;
69 } xen_crashdump_record;
71 /**
72 * Allocate a xen_crashdump_record.
73 */
74 extern xen_crashdump_record *
75 xen_crashdump_record_alloc(void);
77 /**
78 * Free the given xen_crashdump_record, and all referenced values. The
79 * given record must have been allocated by this library.
80 */
81 extern void
82 xen_crashdump_record_free(xen_crashdump_record *record);
85 typedef struct xen_crashdump_record_opt
86 {
87 bool is_record;
88 union
89 {
90 xen_crashdump handle;
91 xen_crashdump_record *record;
92 } u;
93 } xen_crashdump_record_opt;
95 /**
96 * Allocate a xen_crashdump_record_opt.
97 */
98 extern xen_crashdump_record_opt *
99 xen_crashdump_record_opt_alloc(void);
101 /**
102 * Free the given xen_crashdump_record_opt, and all referenced values.
103 * The given record_opt must have been allocated by this library.
104 */
105 extern void
106 xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
109 typedef struct xen_crashdump_record_set
110 {
111 size_t size;
112 xen_crashdump_record *contents[];
113 } xen_crashdump_record_set;
115 /**
116 * Allocate a xen_crashdump_record_set of the given size.
117 */
118 extern xen_crashdump_record_set *
119 xen_crashdump_record_set_alloc(size_t size);
121 /**
122 * Free the given xen_crashdump_record_set, and all referenced values.
123 * The given set must have been allocated by this library.
124 */
125 extern void
126 xen_crashdump_record_set_free(xen_crashdump_record_set *set);
130 typedef struct xen_crashdump_record_opt_set
131 {
132 size_t size;
133 xen_crashdump_record_opt *contents[];
134 } xen_crashdump_record_opt_set;
136 /**
137 * Allocate a xen_crashdump_record_opt_set of the given size.
138 */
139 extern xen_crashdump_record_opt_set *
140 xen_crashdump_record_opt_set_alloc(size_t size);
142 /**
143 * Free the given xen_crashdump_record_opt_set, and all referenced
144 * values. The given set must have been allocated by this library.
145 */
146 extern void
147 xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
150 /**
151 * Get a record containing the current state of the given crashdump.
152 */
153 extern bool
154 xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
157 /**
158 * Get a reference to the crashdump instance with the specified UUID.
159 */
160 extern bool
161 xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
164 /**
165 * Create a new crashdump instance, and return its handle.
166 */
167 extern bool
168 xen_crashdump_create(xen_session *session, xen_crashdump *result, xen_crashdump_record *record);
171 /**
172 * Destroy the specified crashdump instance.
173 */
174 extern bool
175 xen_crashdump_destroy(xen_session *session, xen_crashdump crashdump);
178 /**
179 * Get the uuid field of the given crashdump.
180 */
181 extern bool
182 xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
185 /**
186 * Get the VM field of the given crashdump.
187 */
188 extern bool
189 xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
192 /**
193 * Get the VDI field of the given crashdump.
194 */
195 extern bool
196 xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
199 /**
200 * Return a list of all the crashdumps known to the system.
201 */
202 extern bool
203 xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
206 #endif