debuggers.hg

view tools/libxl/libxl.h @ 22865:67d5b8004947

libxl: band-aid for functions which return literal "-1"

Many libxl functions erroneously return "-1" on error, rather than
some ERROR_* value.

To deal with this, invent a new ERROR_NONSPECIFIC "-1" which indicates
that "the function which generated this error code is broken".

Fix up the one we care about for forthcoming duplicate domain
detection (libxl_name_to_domid) and the others following the same
pattern nearby; leave the rest for post-4.1.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Ian Jackson <ian.jackson@eu.citrix.com>
date Wed Jan 26 11:58:45 2011 +0000 (2011-01-26)
parents 6ec61438713a
children ccfa0527893e
line source
1 /*
2 * Copyright (C) 2009 Citrix Ltd.
3 * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; version 2.1 only. with the special
8 * exception on linking described in file LICENSE.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 */
16 /*
17 * libxl memory management
18 *
19 * From the point of view of the application (ie, libxl's caller),
20 * struct libxl_ctx* is threadsafe, and all returned allocated
21 * structures are obtained from malloc(), and must be freed by the
22 * caller either directly or by calling an appropriate free function
23 * provided by libxl. Ie the application does not get automatic
24 * assistance from libxl in managing these allocations.
25 *
26 * Specific details are in the header comments which should be found
27 * in libxl.h or libxlutil.h, next to the relevant function
28 * declarations.
29 *
30 * Internally, libxl has a garbage collection scheme which allows much libxl
31 * code to allocate strings etc. for internal use without needing to
32 * free them. These are called "temporary allocations".
33 *
34 * The pool for these temporary allocations, along with any other
35 * thread-specific data which is private to libxl but shared between
36 * libxl functions (such as the current xenstore transaction), is
37 * stored in the "gc context" which is a special enhanced context
38 * structure allocated automatically by convenience macros at every
39 * entry to libxl.
40 *
41 * Every libxl function falls into one of these categories:
42 *
43 * 1. Public functions (declared in libxl.h, libxlutil.h), which may
44 * be called by libxl applications. If a public function returns
45 * any allocated object to its caller, that object must have come
46 * from malloc.
47 *
48 * The definitions of public functions MUST use the gc context
49 * initialisation macros (or do the equivalent work themselves).
50 * These macros will ensure that all temporary allocations will be
51 * automatically freed before the function returns to its caller.
52 *
53 * A public function may be called from within libxl; the call
54 * context initialisation macros will make sure that the internal
55 * caller's context is reused (eg, so that the same xenstore
56 * transaction is used).
57 *
58 * Public functions have names like libxl_foobar.
59 *
60 * 2. Private functions, which may not be called by libxl
61 * applications; they are not declared in libxl.h or libxlutil.h
62 * and they may not be called other than by other libxl functions.
63 *
64 * Private functions should not use the gc context initialisation
65 * macros.
66 *
67 * Private functions have names like libxl__foobar (NB, two underscores).
68 * Also the declaration of such functions must be preceeded by the _hidden
69 * macro.
70 *
71 * Allocations made by a libxl function fall into one of the following
72 * categories (where "object" includes any memory allocation):
73 *
74 * (a) Objects which are not returned to the function's caller.
75 * These should be allocated from the temporary pool.
76 *
77 * (b) Objects which are intended for return to the calling
78 * application. This includes all allocated objects returned by
79 * any public function.
80 *
81 * It may also include objects allocated by an internal function
82 * specifically for eventual return by the function's external
83 * callers, but this situation should be clearly documented in
84 * comments.
85 *
86 * These should be allocated from malloc() et al. and comments
87 * near the function declaration should explain the memory
88 * ownership. If a simple free() by the application is not
89 * sufficient, a suitable public freeing function should be
90 * provided.
91 *
92 * (c) Internal objects whose size and/or lifetime dictate explicit
93 * memory management within libxl. This includes objects which
94 * will be embedded in opaque structures which will be returned to
95 * the libxl caller (more generally, any internal object whose
96 * lifetime exceeds the libxl entrypoint which creates it) and
97 * objects which are so large or numerous that explicit memory
98 * management is required.
99 *
100 * These should be allocated from malloc() et al., and freed
101 * explicitly at the appropriate point. The situation should be
102 * documented in comments.
103 *
104 * (d) Objects which are allocated by internal-only functions and
105 * returned to the function's (therefore, internal) caller but are
106 * strictly for internal use by other parts of libxl. These
107 * should be allocated from the temporary pool.
108 *
109 * Where a function's primary purpose is to return such an object,
110 * it should have a libxl__gc * as it's first argument.
111 *
112 * Note that there are two ways to change an allocation from this
113 * category to the "public" category. Either the implementation
114 * is kept internal and a wrapper function duplicates all memory
115 * allocations so that they are suitable for return to external
116 * callers or the implementation uses plain malloc() et al calls
117 * and an internal wrapper adds the relevant pointers to the gc.
118 * The latter method is preferred for obvious performance reasons.
119 *
120 * No temporary objects allocated from the pool may be explicitly freed.
121 * Therefore public functions which initialize a libxl__gc MUST call
122 * libxl__free_all() before returning.
123 */
124 #ifndef LIBXL_H
125 #define LIBXL_H
127 #include <stdint.h>
128 #include <stdarg.h>
129 #include <netinet/in.h>
130 #include <xenctrl.h>
131 #include <xs.h>
132 #include <sys/wait.h> /* for pid_t */
134 #include "libxl_uuid.h"
136 typedef uint8_t libxl_mac[6];
138 typedef char **libxl_string_list;
139 void libxl_string_list_destroy(libxl_string_list *sl);
141 typedef char **libxl_key_value_list;
142 void libxl_key_value_list_destroy(libxl_key_value_list *kvl);
144 typedef uint32_t libxl_hwcap[8];
146 typedef struct {
147 uint32_t size; /* number of bytes in map */
148 uint8_t *map;
149 } libxl_cpumap;
150 void libxl_cpumap_destroy(libxl_cpumap *map);
152 typedef struct {
153 uint32_t entries;
154 uint32_t *array;
155 } libxl_cpuarray;
156 #define LIBXL_CPUARRAY_INVALID_ENTRY ~0
157 void libxl_cpuarray_destroy(libxl_cpuarray *array);
159 typedef enum {
160 XENFV = 1,
161 XENPV,
162 } libxl_qemu_machine_type;
164 typedef enum {
165 LIBXL_CONSTYPE_SERIAL = 1,
166 LIBXL_CONSTYPE_PV,
167 } libxl_console_constype;
169 typedef enum {
170 LIBXL_CONSBACK_XENCONSOLED,
171 LIBXL_CONSBACK_IOEMU,
172 } libxl_console_consback;
174 typedef enum {
175 PHYSTYPE_QCOW = 1,
176 PHYSTYPE_QCOW2,
177 PHYSTYPE_VHD,
178 PHYSTYPE_AIO,
179 PHYSTYPE_FILE,
180 PHYSTYPE_PHY,
181 PHYSTYPE_EMPTY,
182 } libxl_disk_phystype;
184 typedef enum {
185 NICTYPE_IOEMU = 1,
186 NICTYPE_VIF,
187 } libxl_nic_type;
189 typedef struct {
190 /*
191 * Path is always set if the file reference is valid. However if
192 * mapped is true then the actual file may already be unlinked.
193 */
194 char * path;
195 int mapped;
196 void * data;
197 size_t size;
198 } libxl_file_reference;
199 void libxl_file_reference_destroy(libxl_file_reference *p);
201 /* libxl_cpuid_policy_list is a dynamic array storing CPUID policies
202 * for multiple leafs. It is terminated with an entry holding
203 * XEN_CPUID_INPUT_UNUSED in input[0]
204 */
205 typedef struct libxl__cpuid_policy libxl_cpuid_policy;
206 typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
207 void libxl_cpuid_destroy(libxl_cpuid_policy_list *cpuid_list);
209 #define LIBXL_PCI_FUNC_ALL (~0U)
211 #include "_libxl_types.h"
213 typedef struct {
214 xentoollog_logger *lg;
215 xc_interface *xch;
216 struct xs_handle *xsh;
218 /* for callers who reap children willy-nilly; caller must only
219 * set this after libxl_init and before any other call - or
220 * may leave them untouched */
221 int (*waitpid_instead)(pid_t pid, int *status, int flags);
222 libxl_version_info version_info;
223 } libxl_ctx;
225 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
227 typedef struct {
228 #define XL_SUSPEND_DEBUG 1
229 #define XL_SUSPEND_LIVE 2
230 int flags;
231 int (*suspend_callback)(void *, int);
232 } libxl_domain_suspend_info;
234 enum {
235 ERROR_NONSPECIFIC = -1,
236 ERROR_VERSION = -2,
237 ERROR_FAIL = -3,
238 ERROR_NI = -4,
239 ERROR_NOMEM = -5,
240 ERROR_INVAL = -6,
241 ERROR_BADFAIL = -7,
242 };
244 #define LIBXL_VERSION 0
246 enum libxl_action_on_shutdown {
247 LIBXL_ACTION_DESTROY,
249 LIBXL_ACTION_RESTART,
250 LIBXL_ACTION_RESTART_RENAME,
252 LIBXL_ACTION_PRESERVE,
254 LIBXL_ACTION_COREDUMP_DESTROY,
255 LIBXL_ACTION_COREDUMP_RESTART,
256 };
258 typedef struct {
259 libxl_domain_create_info c_info;
260 libxl_domain_build_info b_info;
261 libxl_device_model_info dm_info;
263 int num_disks, num_vifs, num_vif2s, num_pcidevs, num_vfbs, num_vkbs;
265 libxl_device_disk *disks;
266 libxl_device_nic *vifs;
267 libxl_device_net2 *vif2s;
268 libxl_device_pci *pcidevs;
269 libxl_device_vfb *vfbs;
270 libxl_device_vkb *vkbs;
272 enum libxl_action_on_shutdown on_poweroff;
273 enum libxl_action_on_shutdown on_reboot;
274 enum libxl_action_on_shutdown on_watchdog;
275 enum libxl_action_on_shutdown on_crash;
276 } libxl_domain_config;
278 /* context functions */
279 int libxl_ctx_init(libxl_ctx *ctx, int version, xentoollog_logger*);
280 int libxl_ctx_free(libxl_ctx *ctx);
281 int libxl_ctx_set_log(libxl_ctx *ctx, xentoollog_logger*);
282 int libxl_ctx_postfork(libxl_ctx *ctx);
284 /* domain related functions */
285 void libxl_init_create_info(libxl_domain_create_info *c_info);
286 void libxl_init_build_info(libxl_domain_build_info *b_info, libxl_domain_create_info *c_info);
287 void libxl_init_dm_info(libxl_device_model_info *dm_info, libxl_domain_create_info *c_info, libxl_domain_build_info *b_info);
288 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
289 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
290 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
291 void libxl_domain_config_destroy(libxl_domain_config *d_config);
292 int libxl_domain_suspend(libxl_ctx *ctx, libxl_domain_suspend_info *info,
293 uint32_t domid, int fd);
294 int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid);
295 int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid, int req);
296 int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid, int force);
297 int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_info *info, const char *name_suffix, libxl_uuid new_uuid);
299 /* get max. number of cpus supported by hypervisor */
300 int libxl_get_max_cpus(libxl_ctx *ctx);
302 /*
303 * Run the configured bootloader for a PV domain and update
304 * info->kernel, info->u.pv.ramdisk and info->u.pv.cmdline as
305 * appropriate (any initial values present in these fields must have
306 * been allocated with malloc).
307 *
308 * Is a NOP on non-PV domains or those with no bootloader configured.
309 *
310 * Users should call libxl_file_reference_unmap on the kernel and
311 * ramdisk to cleanup or rely on libxl_domain_{build,restore} to do
312 * it.
313 */
314 int libxl_run_bootloader(libxl_ctx *ctx,
315 libxl_domain_build_info *info,
316 libxl_device_disk *disk,
317 uint32_t domid);
319 /* 0 means ERROR_ENOMEM, which we have logged */
321 /* events handling */
323 typedef enum {
324 LIBXL_EVENT_DOMAIN_DEATH,
325 LIBXL_EVENT_DISK_EJECT,
326 } libxl_event_type;
328 typedef struct {
329 /* event type */
330 libxl_event_type type;
331 /* data for internal use of the library */
332 char *path;
333 char *token;
334 } libxl_event;
336 typedef struct {
337 char *path;
338 char *token;
339 } libxl_waiter;
342 int libxl_get_wait_fd(libxl_ctx *ctx, int *fd);
343 /* waiter is allocated by the caller */
344 int libxl_wait_for_domain_death(libxl_ctx *ctx, uint32_t domid, libxl_waiter *waiter);
345 /* waiter is a preallocated array of num_disks libxl_waiter elements */
346 int libxl_wait_for_disk_ejects(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disks, int num_disks, libxl_waiter *waiter);
347 int libxl_get_event(libxl_ctx *ctx, libxl_event *event);
348 int libxl_stop_waiting(libxl_ctx *ctx, libxl_waiter *waiter);
349 int libxl_free_event(libxl_event *event);
350 int libxl_free_waiter(libxl_waiter *waiter);
352 /*
353 * Returns:
354 * - 0 if the domain is dead but there is no cleanup to be done. e.g
355 * because someone else has already done it.
356 * - 1 if the domain is dead and there is cleanup to be done.
357 *
358 * Can return error if the domain exists and is still running.
359 *
360 * *info will contain valid domain state iff 1 is returned. In
361 * particular if 1 is returned then info->shutdown_reason is
362 * guaranteed to be valid since by definition the domain is
363 * (shutdown||dying))
364 */
365 int libxl_event_get_domain_death_info(libxl_ctx *ctx, uint32_t domid, libxl_event *event, libxl_dominfo *info);
367 /*
368 * Returns true and fills *disk if the caller should eject the disk
369 */
370 int libxl_event_get_disk_eject_info(libxl_ctx *ctx, uint32_t domid, libxl_event *event, libxl_device_disk *disk);
372 int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
373 const char *old_name, const char *new_name,
374 xs_transaction_t trans);
375 /* if old_name is NULL, any old name is OK; otherwise we check
376 * transactionally that the domain has the old old name; if
377 * trans is not 0 we use caller's transaction and caller must do retries */
379 int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid);
380 int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid);
382 int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid, const char *filename);
384 int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t target_memkb);
385 int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, int32_t target_memkb, int relative, int enforce);
386 int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t *out_target);
387 /* how much free memory in the system a domain needs to be built */
388 int libxl_domain_need_memory(libxl_ctx *ctx, libxl_domain_build_info *b_info,
389 libxl_device_model_info *dm_info, uint32_t *need_memkb);
390 /* how much free memory is available in the system */
391 int libxl_get_free_memory(libxl_ctx *ctx, uint32_t *memkb);
392 /* wait for a given amount of memory to be free in the system */
393 int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_kb, int wait_secs);
394 /* wait for the memory target of a domain to be reached */
395 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
397 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
398 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_constype type);
399 /* libxl_primary_console_exec finds the domid and console number
400 * corresponding to the primary console of the given vm, then calls
401 * libxl_console_exec with the right arguments (domid might be different
402 * if the guest is using stubdoms).
403 * This function can be called after creating the device model, in
404 * case of HVM guests, and before libxl_run_bootloader in case of PV
405 * guests using pygrub. */
406 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
408 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
409 uint32_t domid);
410 libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain);
411 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool);
412 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm);
414 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
415 int libxl_device_disk_del(libxl_ctx *ctx, libxl_device_disk *disk, int wait);
416 libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *num);
417 int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
418 libxl_device_disk *disk, libxl_diskinfo *diskinfo);
419 int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
421 /*
422 * Make a disk available in this domain. Returns path to a device.
423 */
424 char * libxl_device_disk_local_attach(libxl_ctx *ctx, libxl_device_disk *disk);
425 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
427 int libxl_device_nic_init(libxl_device_nic *nic, int dev_num);
428 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
429 int libxl_device_nic_del(libxl_ctx *ctx, libxl_device_nic *nic, int wait);
430 libxl_nicinfo *libxl_list_nics(libxl_ctx *ctx, uint32_t domid, unsigned int *nb);
432 int libxl_device_console_add(libxl_ctx *ctx, uint32_t domid, libxl_device_console *console);
434 void libxl_device_vkb_init(libxl_device_vkb *vkb, int dev_num);
435 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
436 int libxl_device_vkb_clean_shutdown(libxl_ctx *ctx, uint32_t domid);
437 int libxl_device_vkb_hard_shutdown(libxl_ctx *ctx, uint32_t domid);
439 void libxl_device_vfb_init(libxl_device_vfb *vfb, int dev_num);
440 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
441 int libxl_device_vfb_clean_shutdown(libxl_ctx *ctx, uint32_t domid);
442 int libxl_device_vfb_hard_shutdown(libxl_ctx *ctx, uint32_t domid);
444 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
445 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev, int force);
446 int libxl_device_pci_shutdown(libxl_ctx *ctx, uint32_t domid);
447 int libxl_device_pci_list_assigned(libxl_ctx *ctx, libxl_device_pci **list, uint32_t domid, int *num);
448 int libxl_device_pci_list_assignable(libxl_ctx *ctx, libxl_device_pci **list, int *num);
449 int libxl_device_pci_parse_bdf(libxl_ctx *ctx, libxl_device_pci *pcidev, const char *str);
450 int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
451 int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
452 const char* str);
453 void libxl_cpuid_apply_policy(libxl_ctx *ctx, uint32_t domid);
454 void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid,
455 libxl_cpuid_policy_list cpuid);
457 /*
458 * Functions for allowing users of libxl to store private data
459 * relating to a domain. The data is an opaque sequence of bytes and
460 * is not interpreted or used by libxl.
461 *
462 * Data is indexed by the userdata userid, which is a short printable
463 * ASCII string. The following list is a registry of userdata userids
464 * (the registry may be updated by posting a patch to xen-devel):
465 *
466 * userid Data contents
467 * "xl" domain config file in xl format, Unix line endings
468 *
469 * libxl does not enforce the registration of userdata userids or the
470 * semantics of the data. For specifications of the data formats
471 * see the code or documentation for the libxl caller in question.
472 */
473 int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
474 const char *userdata_userid,
475 const uint8_t *data, int datalen);
476 /* If datalen==0, data is not used and the user data for
477 * that domain and userdata_userid is deleted. */
478 int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid,
479 const char *userdata_userid,
480 uint8_t **data_r, int *datalen_r);
481 /* On successful return, *data_r is from malloc.
482 * If there is no data for that domain and userdata_userid,
483 * *data_r and *datalen_r will be set to 0.
484 * data_r and datalen_r may be 0.
485 * On error return, *data_r and *datalen_r are undefined.
486 */
488 typedef enum {
489 POWER_BUTTON,
490 SLEEP_BUTTON
491 } libxl_button;
493 int libxl_button_press(libxl_ctx *ctx, uint32_t domid, libxl_button button);
495 int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
496 int libxl_get_topologyinfo(libxl_ctx *ctx, libxl_topologyinfo *info);
497 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
498 int *nb_vcpu, int *nrcpus);
499 int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
500 libxl_cpumap *cpumap);
501 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, uint32_t bitmask);
503 int libxl_get_sched_id(libxl_ctx *ctx);
506 int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid,
507 libxl_sched_credit *scinfo);
508 int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid,
509 libxl_sched_credit *scinfo);
510 int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
511 char *trigger_name, uint32_t vcpuid);
512 int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
513 int libxl_send_debug_keys(libxl_ctx *ctx, char *keys);
515 typedef struct libxl__xen_console_reader libxl_xen_console_reader;
517 libxl_xen_console_reader *
518 libxl_xen_console_read_start(libxl_ctx *ctx, int clear);
519 int libxl_xen_console_read_line(libxl_ctx *ctx,
520 libxl_xen_console_reader *cr,
521 char **line_r);
522 void libxl_xen_console_read_finish(libxl_ctx *ctx,
523 libxl_xen_console_reader *cr);
525 uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid);
527 char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long);
528 int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid);
529 int libxl_tmem_destroy(libxl_ctx *ctx, uint32_t domid);
530 int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid);
531 int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name,
532 uint32_t set);
533 int libxl_tmem_shared_auth(libxl_ctx *ctx, uint32_t domid, char* uuid,
534 int auth);
535 int libxl_tmem_freeable(libxl_ctx *ctx);
537 void libxl_device_net2_init(libxl_device_net2 *net2, int dev_num);
538 int libxl_device_net2_add(libxl_ctx *ctx, uint32_t domid,
539 libxl_device_net2 *net2);
540 libxl_net2info *libxl_device_net2_list(libxl_ctx *ctx, uint32_t domid,
541 unsigned int *nb);
542 int libxl_device_net2_del(libxl_ctx *ctx, libxl_device_net2 *net2,
543 int wait);
545 int libxl_get_freecpus(libxl_ctx *ctx, libxl_cpumap *cpumap);
546 int libxl_create_cpupool(libxl_ctx *ctx, const char *name, int schedid,
547 libxl_cpumap cpumap, libxl_uuid *uuid,
548 uint32_t *poolid);
549 int libxl_destroy_cpupool(libxl_ctx *ctx, uint32_t poolid);
550 int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid);
551 int libxl_cpupool_cpuadd(libxl_ctx *ctx, uint32_t poolid, int cpu);
552 int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
553 int libxl_cpupool_cpuremove(libxl_ctx *ctx, uint32_t poolid, int cpu);
554 int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
555 int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
557 /* common paths */
558 const char *libxl_sbindir_path(void);
559 const char *libxl_bindir_path(void);
560 const char *libxl_libexec_path(void);
561 const char *libxl_libdir_path(void);
562 const char *libxl_sharedir_path(void);
563 const char *libxl_private_bindir_path(void);
564 const char *libxl_xenfirmwaredir_path(void);
565 const char *libxl_xen_config_dir_path(void);
566 const char *libxl_xen_script_dir_path(void);
567 const char *libxl_lock_dir_path(void);
569 #endif /* LIBXL_H */