debuggers.hg

view tools/libxl/libxl.h @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents 77e8775fccef
children 6ec61438713a
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 } libxl_disk_phystype;
183 typedef enum {
184 NICTYPE_IOEMU = 1,
185 NICTYPE_VIF,
186 } libxl_nic_type;
188 typedef struct {
189 /*
190 * Path is always set if the file reference is valid. However if
191 * mapped is true then the actual file may already be unlinked.
192 */
193 char * path;
194 int mapped;
195 void * data;
196 size_t size;
197 } libxl_file_reference;
198 void libxl_file_reference_destroy(libxl_file_reference *p);
200 /* libxl_cpuid_policy_list is a dynamic array storing CPUID policies
201 * for multiple leafs. It is terminated with an entry holding
202 * XEN_CPUID_INPUT_UNUSED in input[0]
203 */
204 typedef struct libxl__cpuid_policy libxl_cpuid_policy;
205 typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
206 void libxl_cpuid_destroy(libxl_cpuid_policy_list *cpuid_list);
208 #define LIBXL_PCI_FUNC_ALL (~0U)
210 #include "_libxl_types.h"
212 typedef struct {
213 xentoollog_logger *lg;
214 xc_interface *xch;
215 struct xs_handle *xsh;
217 /* for callers who reap children willy-nilly; caller must only
218 * set this after libxl_init and before any other call - or
219 * may leave them untouched */
220 int (*waitpid_instead)(pid_t pid, int *status, int flags);
221 libxl_version_info version_info;
222 } libxl_ctx;
224 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
226 typedef struct {
227 #define XL_SUSPEND_DEBUG 1
228 #define XL_SUSPEND_LIVE 2
229 int flags;
230 int (*suspend_callback)(void *, int);
231 } libxl_domain_suspend_info;
233 enum {
234 ERROR_VERSION = -1,
235 ERROR_FAIL = -2,
236 ERROR_NI = -3,
237 ERROR_NOMEM = -4,
238 ERROR_INVAL = -5,
239 ERROR_BADFAIL = -6,
240 };
242 #define LIBXL_VERSION 0
244 enum libxl_action_on_shutdown {
245 LIBXL_ACTION_DESTROY,
247 LIBXL_ACTION_RESTART,
248 LIBXL_ACTION_RESTART_RENAME,
250 LIBXL_ACTION_PRESERVE,
252 LIBXL_ACTION_COREDUMP_DESTROY,
253 LIBXL_ACTION_COREDUMP_RESTART,
254 };
256 typedef struct {
257 libxl_domain_create_info c_info;
258 libxl_domain_build_info b_info;
259 libxl_device_model_info dm_info;
261 int num_disks, num_vifs, num_vif2s, num_pcidevs, num_vfbs, num_vkbs;
263 libxl_device_disk *disks;
264 libxl_device_nic *vifs;
265 libxl_device_net2 *vif2s;
266 libxl_device_pci *pcidevs;
267 libxl_device_vfb *vfbs;
268 libxl_device_vkb *vkbs;
270 enum libxl_action_on_shutdown on_poweroff;
271 enum libxl_action_on_shutdown on_reboot;
272 enum libxl_action_on_shutdown on_watchdog;
273 enum libxl_action_on_shutdown on_crash;
274 } libxl_domain_config;
276 /* context functions */
277 int libxl_ctx_init(libxl_ctx *ctx, int version, xentoollog_logger*);
278 int libxl_ctx_free(libxl_ctx *ctx);
279 int libxl_ctx_set_log(libxl_ctx *ctx, xentoollog_logger*);
280 int libxl_ctx_postfork(libxl_ctx *ctx);
282 /* domain related functions */
283 void libxl_init_create_info(libxl_domain_create_info *c_info);
284 void libxl_init_build_info(libxl_domain_build_info *b_info, libxl_domain_create_info *c_info);
285 void libxl_init_dm_info(libxl_device_model_info *dm_info, libxl_domain_create_info *c_info, libxl_domain_build_info *b_info);
286 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
287 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
288 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);
289 void libxl_domain_config_destroy(libxl_domain_config *d_config);
290 int libxl_domain_suspend(libxl_ctx *ctx, libxl_domain_suspend_info *info,
291 uint32_t domid, int fd);
292 int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid);
293 int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid, int req);
294 int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid, int force);
295 int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_info *info, const char *name_suffix, libxl_uuid new_uuid);
297 /* get max. number of cpus supported by hypervisor */
298 int libxl_get_max_cpus(libxl_ctx *ctx);
300 /*
301 * Run the configured bootloader for a PV domain and update
302 * info->kernel, info->u.pv.ramdisk and info->u.pv.cmdline as
303 * appropriate (any initial values present in these fields must have
304 * been allocated with malloc).
305 *
306 * Is a NOP on non-PV domains or those with no bootloader configured.
307 *
308 * Users should call libxl_file_reference_unmap on the kernel and
309 * ramdisk to cleanup or rely on libxl_domain_{build,restore} to do
310 * it.
311 */
312 int libxl_run_bootloader(libxl_ctx *ctx,
313 libxl_domain_build_info *info,
314 libxl_device_disk *disk,
315 uint32_t domid);
317 /* 0 means ERROR_ENOMEM, which we have logged */
319 /* events handling */
321 typedef enum {
322 LIBXL_EVENT_DOMAIN_DEATH,
323 LIBXL_EVENT_DISK_EJECT,
324 } libxl_event_type;
326 typedef struct {
327 /* event type */
328 libxl_event_type type;
329 /* data for internal use of the library */
330 char *path;
331 char *token;
332 } libxl_event;
334 typedef struct {
335 char *path;
336 char *token;
337 } libxl_waiter;
340 int libxl_get_wait_fd(libxl_ctx *ctx, int *fd);
341 /* waiter is allocated by the caller */
342 int libxl_wait_for_domain_death(libxl_ctx *ctx, uint32_t domid, libxl_waiter *waiter);
343 /* waiter is a preallocated array of num_disks libxl_waiter elements */
344 int libxl_wait_for_disk_ejects(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disks, int num_disks, libxl_waiter *waiter);
345 int libxl_get_event(libxl_ctx *ctx, libxl_event *event);
346 int libxl_stop_waiting(libxl_ctx *ctx, libxl_waiter *waiter);
347 int libxl_free_event(libxl_event *event);
348 int libxl_free_waiter(libxl_waiter *waiter);
350 /*
351 * Returns:
352 * - 0 if the domain is dead but there is no cleanup to be done. e.g
353 * because someone else has already done it.
354 * - 1 if the domain is dead and there is cleanup to be done.
355 *
356 * Can return error if the domain exists and is still running.
357 *
358 * *info will contain valid domain state iff 1 is returned. In
359 * particular if 1 is returned then info->shutdown_reason is
360 * guaranteed to be valid since by definition the domain is
361 * (shutdown||dying))
362 */
363 int libxl_event_get_domain_death_info(libxl_ctx *ctx, uint32_t domid, libxl_event *event, libxl_dominfo *info);
365 /*
366 * Returns true and fills *disk if the caller should eject the disk
367 */
368 int libxl_event_get_disk_eject_info(libxl_ctx *ctx, uint32_t domid, libxl_event *event, libxl_device_disk *disk);
370 int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
371 const char *old_name, const char *new_name,
372 xs_transaction_t trans);
373 /* if old_name is NULL, any old name is OK; otherwise we check
374 * transactionally that the domain has the old old name; if
375 * trans is not 0 we use caller's transaction and caller must do retries */
377 int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid);
378 int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid);
380 int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid, const char *filename);
382 int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t target_memkb);
383 int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, int32_t target_memkb, int relative, int enforce);
384 int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t *out_target);
385 /* how much free memory in the system a domain needs to be built */
386 int libxl_domain_need_memory(libxl_ctx *ctx, libxl_domain_build_info *b_info,
387 libxl_device_model_info *dm_info, uint32_t *need_memkb);
388 /* how much free memory is available in the system */
389 int libxl_get_free_memory(libxl_ctx *ctx, uint32_t *memkb);
390 /* wait for a given amount of memory to be free in the system */
391 int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_kb, int wait_secs);
392 /* wait for the memory target of a domain to be reached */
393 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
395 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
396 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_constype type);
397 /* libxl_primary_console_exec finds the domid and console number
398 * corresponding to the primary console of the given vm, then calls
399 * libxl_console_exec with the right arguments (domid might be different
400 * if the guest is using stubdoms).
401 * This function can be called after creating the device model, in
402 * case of HVM guests, and before libxl_run_bootloader in case of PV
403 * guests using pygrub. */
404 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
406 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
407 uint32_t domid);
408 libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain);
409 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool);
410 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm);
412 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
413 int libxl_device_disk_del(libxl_ctx *ctx, libxl_device_disk *disk, int wait);
414 libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *num);
415 int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
416 libxl_device_disk *disk, libxl_diskinfo *diskinfo);
417 int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
419 /*
420 * Make a disk available in this domain. Returns path to a device.
421 */
422 char * libxl_device_disk_local_attach(libxl_ctx *ctx, libxl_device_disk *disk);
423 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
425 int libxl_device_nic_init(libxl_device_nic *nic, int dev_num);
426 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
427 int libxl_device_nic_del(libxl_ctx *ctx, libxl_device_nic *nic, int wait);
428 libxl_nicinfo *libxl_list_nics(libxl_ctx *ctx, uint32_t domid, unsigned int *nb);
430 int libxl_device_console_add(libxl_ctx *ctx, uint32_t domid, libxl_device_console *console);
432 void libxl_device_vkb_init(libxl_device_vkb *vkb, int dev_num);
433 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
434 int libxl_device_vkb_clean_shutdown(libxl_ctx *ctx, uint32_t domid);
435 int libxl_device_vkb_hard_shutdown(libxl_ctx *ctx, uint32_t domid);
437 void libxl_device_vfb_init(libxl_device_vfb *vfb, int dev_num);
438 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
439 int libxl_device_vfb_clean_shutdown(libxl_ctx *ctx, uint32_t domid);
440 int libxl_device_vfb_hard_shutdown(libxl_ctx *ctx, uint32_t domid);
442 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
443 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev, int force);
444 int libxl_device_pci_shutdown(libxl_ctx *ctx, uint32_t domid);
445 int libxl_device_pci_list_assigned(libxl_ctx *ctx, libxl_device_pci **list, uint32_t domid, int *num);
446 int libxl_device_pci_list_assignable(libxl_ctx *ctx, libxl_device_pci **list, int *num);
447 int libxl_device_pci_parse_bdf(libxl_ctx *ctx, libxl_device_pci *pcidev, const char *str);
448 int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
449 int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
450 const char* str);
451 void libxl_cpuid_apply_policy(libxl_ctx *ctx, uint32_t domid);
452 void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid,
453 libxl_cpuid_policy_list cpuid);
455 /*
456 * Functions for allowing users of libxl to store private data
457 * relating to a domain. The data is an opaque sequence of bytes and
458 * is not interpreted or used by libxl.
459 *
460 * Data is indexed by the userdata userid, which is a short printable
461 * ASCII string. The following list is a registry of userdata userids
462 * (the registry may be updated by posting a patch to xen-devel):
463 *
464 * userid Data contents
465 * "xl" domain config file in xl format, Unix line endings
466 *
467 * libxl does not enforce the registration of userdata userids or the
468 * semantics of the data. For specifications of the data formats
469 * see the code or documentation for the libxl caller in question.
470 */
471 int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
472 const char *userdata_userid,
473 const uint8_t *data, int datalen);
474 /* If datalen==0, data is not used and the user data for
475 * that domain and userdata_userid is deleted. */
476 int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid,
477 const char *userdata_userid,
478 uint8_t **data_r, int *datalen_r);
479 /* On successful return, *data_r is from malloc.
480 * If there is no data for that domain and userdata_userid,
481 * *data_r and *datalen_r will be set to 0.
482 * data_r and datalen_r may be 0.
483 * On error return, *data_r and *datalen_r are undefined.
484 */
486 typedef enum {
487 POWER_BUTTON,
488 SLEEP_BUTTON
489 } libxl_button;
491 int libxl_button_press(libxl_ctx *ctx, uint32_t domid, libxl_button button);
493 int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
494 int libxl_get_topologyinfo(libxl_ctx *ctx, libxl_topologyinfo *info);
495 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
496 int *nb_vcpu, int *nrcpus);
497 int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
498 libxl_cpumap *cpumap);
499 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, uint32_t bitmask);
501 int libxl_get_sched_id(libxl_ctx *ctx);
504 int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid,
505 libxl_sched_credit *scinfo);
506 int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid,
507 libxl_sched_credit *scinfo);
508 int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
509 char *trigger_name, uint32_t vcpuid);
510 int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
511 int libxl_send_debug_keys(libxl_ctx *ctx, char *keys);
513 typedef struct libxl__xen_console_reader libxl_xen_console_reader;
515 libxl_xen_console_reader *
516 libxl_xen_console_read_start(libxl_ctx *ctx, int clear);
517 int libxl_xen_console_read_line(libxl_ctx *ctx,
518 libxl_xen_console_reader *cr,
519 char **line_r);
520 void libxl_xen_console_read_finish(libxl_ctx *ctx,
521 libxl_xen_console_reader *cr);
523 uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid);
525 char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long);
526 int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid);
527 int libxl_tmem_destroy(libxl_ctx *ctx, uint32_t domid);
528 int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid);
529 int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name,
530 uint32_t set);
531 int libxl_tmem_shared_auth(libxl_ctx *ctx, uint32_t domid, char* uuid,
532 int auth);
533 int libxl_tmem_freeable(libxl_ctx *ctx);
535 void libxl_device_net2_init(libxl_device_net2 *net2, int dev_num);
536 int libxl_device_net2_add(libxl_ctx *ctx, uint32_t domid,
537 libxl_device_net2 *net2);
538 libxl_net2info *libxl_device_net2_list(libxl_ctx *ctx, uint32_t domid,
539 unsigned int *nb);
540 int libxl_device_net2_del(libxl_ctx *ctx, libxl_device_net2 *net2,
541 int wait);
543 int libxl_get_freecpus(libxl_ctx *ctx, libxl_cpumap *cpumap);
544 int libxl_create_cpupool(libxl_ctx *ctx, const char *name, int schedid,
545 libxl_cpumap cpumap, libxl_uuid *uuid,
546 uint32_t *poolid);
547 int libxl_destroy_cpupool(libxl_ctx *ctx, uint32_t poolid);
548 int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid);
549 int libxl_cpupool_cpuadd(libxl_ctx *ctx, uint32_t poolid, int cpu);
550 int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
551 int libxl_cpupool_cpuremove(libxl_ctx *ctx, uint32_t poolid, int cpu);
552 int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
553 int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
555 /* common paths */
556 const char *libxl_sbindir_path(void);
557 const char *libxl_bindir_path(void);
558 const char *libxl_libexec_path(void);
559 const char *libxl_libdir_path(void);
560 const char *libxl_sharedir_path(void);
561 const char *libxl_private_bindir_path(void);
562 const char *libxl_xenfirmwaredir_path(void);
563 const char *libxl_xen_config_dir_path(void);
564 const char *libxl_xen_script_dir_path(void);
565 const char *libxl_lock_dir_path(void);
567 #endif /* LIBXL_H */