ia64/xen-unstable

view tools/libxen/include/xen_vm.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 f73e71aa0a90
children 8c8d91a006ba
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_VM_H
20 #define XEN_VM_H
22 #include "xen_common.h"
23 #include "xen_console_decl.h"
24 #include "xen_crashdump_decl.h"
25 #include "xen_host_decl.h"
26 #include "xen_int_float_map.h"
27 #include "xen_on_crash_behaviour.h"
28 #include "xen_on_normal_exit.h"
29 #include "xen_string_string_map.h"
30 #include "xen_vbd_decl.h"
31 #include "xen_vdi_decl.h"
32 #include "xen_vif_decl.h"
33 #include "xen_vm_decl.h"
34 #include "xen_vm_metrics_decl.h"
35 #include "xen_vm_power_state.h"
36 #include "xen_vtpm_decl.h"
39 /*
40 * The VM class.
41 *
42 * A virtual machine (or 'guest').
43 *
44 * VM booting is controlled by setting one of the two mutually exclusive
45 * groups: "PV", and "HVM". If HVM.boot_policy is the empty string, then
46 * paravirtual domain building and booting will be used; otherwise the VM will
47 * be loaded as an HVM domain, and booted using an emulated BIOS.
48 *
49 * When paravirtual booting is in use, the PV/bootloader field indicates the
50 * bootloader to use. It may be "pygrub", in which case the platform's
51 * default installation of pygrub will be used, or a full path within the
52 * control domain to some other bootloader. The other fields, PV/kernel,
53 * PV/ramdisk, PV/args and PV/bootloader_args will be passed to the bootloader
54 * unmodified, and interpretation of those fields is then specific to the
55 * bootloader itself, including the possibility that the bootloader will
56 * ignore some or all of those given values. Finally the paths of all bootable
57 * disks are added to the bootloader commandline (a disk is bootable if its
58 * VBD has the bootable flag set). There may be zero, one or many bootable
59 * disks; the bootloader decides which disk (if any) to boot from.
60 *
61 * If the bootloader is pygrub, then the menu.lst is parsed if present in the
62 * guest's filesystem, otherwise the specified kernel and ramdisk are used, or
63 * an autodetected kernel is used if nothing is specified and autodetection is
64 * possible. PV/args is appended to the kernel command line, no matter which
65 * mechanism is used for finding the kernel.
66 *
67 * If PV/bootloader is empty but PV/kernel is specified, then the kernel and
68 * ramdisk values will be treated as paths within the control domain. If both
69 * PV/bootloader and PV/kernel are empty, then the behaviour is as if
70 * PV/bootloader was specified as "pygrub".
71 *
72 * When using HVM booting, HVM/boot_policy and HVM/boot_params specify the
73 * boot handling. Only one policy is currently defined: "BIOS order". In
74 * this case, HVM/boot_params should contain one key-value pair "order" = "N"
75 * where N is the string that will be passed to QEMU..
76 */
79 /**
80 * Free the given xen_vm. The given handle must have been allocated by
81 * this library.
82 */
83 extern void
84 xen_vm_free(xen_vm vm);
87 typedef struct xen_vm_set
88 {
89 size_t size;
90 xen_vm *contents[];
91 } xen_vm_set;
93 /**
94 * Allocate a xen_vm_set of the given size.
95 */
96 extern xen_vm_set *
97 xen_vm_set_alloc(size_t size);
99 /**
100 * Free the given xen_vm_set. The given set must have been allocated
101 * by this library.
102 */
103 extern void
104 xen_vm_set_free(xen_vm_set *set);
107 typedef struct xen_vm_record
108 {
109 xen_vm handle;
110 char *uuid;
111 enum xen_vm_power_state power_state;
112 char *name_label;
113 char *name_description;
114 int64_t user_version;
115 bool is_a_template;
116 bool auto_power_on;
117 struct xen_vdi_record_opt *suspend_vdi;
118 struct xen_host_record_opt *resident_on;
119 int64_t memory_static_max;
120 int64_t memory_dynamic_max;
121 int64_t memory_dynamic_min;
122 int64_t memory_static_min;
123 char *vcpus_policy;
124 xen_string_string_map *vcpus_params;
125 int64_t vcpus_max;
126 int64_t vcpus_at_startup;
127 int64_t vcpus_number;
128 xen_int_float_map *vcpus_utilisation;
129 enum xen_on_normal_exit actions_after_shutdown;
130 enum xen_on_normal_exit actions_after_reboot;
131 enum xen_on_crash_behaviour actions_after_crash;
132 struct xen_console_record_opt_set *consoles;
133 struct xen_vif_record_opt_set *vifs;
134 struct xen_vbd_record_opt_set *vbds;
135 struct xen_crashdump_record_opt_set *crash_dumps;
136 struct xen_vtpm_record_opt_set *vtpms;
137 char *pv_bootloader;
138 char *pv_kernel;
139 char *pv_ramdisk;
140 char *pv_args;
141 char *pv_bootloader_args;
142 char *hvm_boot_policy;
143 xen_string_string_map *hvm_boot_params;
144 bool platform_std_vga;
145 char *platform_serial;
146 bool platform_localtime;
147 bool platform_clock_offset;
148 bool platform_enable_audio;
149 char *pci_bus;
150 xen_string_string_map *tools_version;
151 xen_string_string_map *other_config;
152 bool is_control_domain;
153 struct xen_vm_metrics_record_opt *metrics;
154 } xen_vm_record;
156 /**
157 * Allocate a xen_vm_record.
158 */
159 extern xen_vm_record *
160 xen_vm_record_alloc(void);
162 /**
163 * Free the given xen_vm_record, and all referenced values. The given
164 * record must have been allocated by this library.
165 */
166 extern void
167 xen_vm_record_free(xen_vm_record *record);
170 typedef struct xen_vm_record_opt
171 {
172 bool is_record;
173 union
174 {
175 xen_vm handle;
176 xen_vm_record *record;
177 } u;
178 } xen_vm_record_opt;
180 /**
181 * Allocate a xen_vm_record_opt.
182 */
183 extern xen_vm_record_opt *
184 xen_vm_record_opt_alloc(void);
186 /**
187 * Free the given xen_vm_record_opt, and all referenced values. The
188 * given record_opt must have been allocated by this library.
189 */
190 extern void
191 xen_vm_record_opt_free(xen_vm_record_opt *record_opt);
194 typedef struct xen_vm_record_set
195 {
196 size_t size;
197 xen_vm_record *contents[];
198 } xen_vm_record_set;
200 /**
201 * Allocate a xen_vm_record_set of the given size.
202 */
203 extern xen_vm_record_set *
204 xen_vm_record_set_alloc(size_t size);
206 /**
207 * Free the given xen_vm_record_set, and all referenced values. The
208 * given set must have been allocated by this library.
209 */
210 extern void
211 xen_vm_record_set_free(xen_vm_record_set *set);
215 typedef struct xen_vm_record_opt_set
216 {
217 size_t size;
218 xen_vm_record_opt *contents[];
219 } xen_vm_record_opt_set;
221 /**
222 * Allocate a xen_vm_record_opt_set of the given size.
223 */
224 extern xen_vm_record_opt_set *
225 xen_vm_record_opt_set_alloc(size_t size);
227 /**
228 * Free the given xen_vm_record_opt_set, and all referenced values.
229 * The given set must have been allocated by this library.
230 */
231 extern void
232 xen_vm_record_opt_set_free(xen_vm_record_opt_set *set);
235 /**
236 * Get a record containing the current state of the given VM.
237 */
238 extern bool
239 xen_vm_get_record(xen_session *session, xen_vm_record **result, xen_vm vm);
242 /**
243 * Get a reference to the VM instance with the specified UUID.
244 */
245 extern bool
246 xen_vm_get_by_uuid(xen_session *session, xen_vm *result, char *uuid);
249 /**
250 * Create a new VM instance, and return its handle.
251 */
252 extern bool
253 xen_vm_create(xen_session *session, xen_vm *result, xen_vm_record *record);
256 /**
257 * Destroy the specified VM. The VM is completely removed from the
258 * system. This function can only be called when the VM is in the Halted
259 * State.
260 */
261 extern bool
262 xen_vm_destroy(xen_session *session, xen_vm vm);
265 /**
266 * Get all the VM instances with the given label.
267 */
268 extern bool
269 xen_vm_get_by_name_label(xen_session *session, struct xen_vm_set **result, char *label);
272 /**
273 * Get the uuid field of the given VM.
274 */
275 extern bool
276 xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm);
279 /**
280 * Get the power_state field of the given VM.
281 */
282 extern bool
283 xen_vm_get_power_state(xen_session *session, enum xen_vm_power_state *result, xen_vm vm);
286 /**
287 * Get the name/label field of the given VM.
288 */
289 extern bool
290 xen_vm_get_name_label(xen_session *session, char **result, xen_vm vm);
293 /**
294 * Get the name/description field of the given VM.
295 */
296 extern bool
297 xen_vm_get_name_description(xen_session *session, char **result, xen_vm vm);
300 /**
301 * Get the user_version field of the given VM.
302 */
303 extern bool
304 xen_vm_get_user_version(xen_session *session, int64_t *result, xen_vm vm);
307 /**
308 * Get the is_a_template field of the given VM.
309 */
310 extern bool
311 xen_vm_get_is_a_template(xen_session *session, bool *result, xen_vm vm);
314 /**
315 * Get the auto_power_on field of the given VM.
316 */
317 extern bool
318 xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
321 /**
322 * Get the suspend_VDI field of the given VM.
323 */
324 extern bool
325 xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm);
328 /**
329 * Get the resident_on field of the given VM.
330 */
331 extern bool
332 xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm);
335 /**
336 * Get the memory/static_max field of the given VM.
337 */
338 extern bool
339 xen_vm_get_memory_static_max(xen_session *session, int64_t *result, xen_vm vm);
342 /**
343 * Get the memory/dynamic_max field of the given VM.
344 */
345 extern bool
346 xen_vm_get_memory_dynamic_max(xen_session *session, int64_t *result, xen_vm vm);
349 /**
350 * Get the memory/dynamic_min field of the given VM.
351 */
352 extern bool
353 xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm);
356 /**
357 * Get the memory/static_min field of the given VM.
358 */
359 extern bool
360 xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm);
363 /**
364 * Get the VCPUs/policy field of the given VM.
365 */
366 extern bool
367 xen_vm_get_vcpus_policy(xen_session *session, char **result, xen_vm vm);
370 /**
371 * Get the VCPUs/params field of the given VM.
372 */
373 extern bool
374 xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
377 /**
378 * Get the VCPUs/max field of the given VM.
379 */
380 extern bool
381 xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm);
384 /**
385 * Get the VCPUs/at_startup field of the given VM.
386 */
387 extern bool
388 xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm);
391 /**
392 * Get the VCPUs/number field of the given VM.
393 */
394 extern bool
395 xen_vm_get_vcpus_number(xen_session *session, int64_t *result, xen_vm vm);
398 /**
399 * Get the VCPUs/utilisation field of the given VM.
400 */
401 extern bool
402 xen_vm_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm vm);
405 /**
406 * Get the actions/after_shutdown field of the given VM.
407 */
408 extern bool
409 xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
412 /**
413 * Get the actions/after_reboot field of the given VM.
414 */
415 extern bool
416 xen_vm_get_actions_after_reboot(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
419 /**
420 * Get the actions/after_crash field of the given VM.
421 */
422 extern bool
423 xen_vm_get_actions_after_crash(xen_session *session, enum xen_on_crash_behaviour *result, xen_vm vm);
426 /**
427 * Get the consoles field of the given VM.
428 */
429 extern bool
430 xen_vm_get_consoles(xen_session *session, struct xen_console_set **result, xen_vm vm);
433 /**
434 * Get the VIFs field of the given VM.
435 */
436 extern bool
437 xen_vm_get_vifs(xen_session *session, struct xen_vif_set **result, xen_vm vm);
440 /**
441 * Get the VBDs field of the given VM.
442 */
443 extern bool
444 xen_vm_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vm vm);
447 /**
448 * Get the crash_dumps field of the given VM.
449 */
450 extern bool
451 xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm);
454 /**
455 * Get the VTPMs field of the given VM.
456 */
457 extern bool
458 xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
461 /**
462 * Get the PV/bootloader field of the given VM.
463 */
464 extern bool
465 xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm);
468 /**
469 * Get the PV/kernel field of the given VM.
470 */
471 extern bool
472 xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm);
475 /**
476 * Get the PV/ramdisk field of the given VM.
477 */
478 extern bool
479 xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm);
482 /**
483 * Get the PV/args field of the given VM.
484 */
485 extern bool
486 xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm);
489 /**
490 * Get the PV/bootloader_args field of the given VM.
491 */
492 extern bool
493 xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm);
496 /**
497 * Get the HVM/boot_policy field of the given VM.
498 */
499 extern bool
500 xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm);
503 /**
504 * Get the HVM/boot_params field of the given VM.
505 */
506 extern bool
507 xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
510 /**
511 * Get the platform/std_VGA field of the given VM.
512 */
513 extern bool
514 xen_vm_get_platform_std_vga(xen_session *session, bool *result, xen_vm vm);
517 /**
518 * Get the platform/serial field of the given VM.
519 */
520 extern bool
521 xen_vm_get_platform_serial(xen_session *session, char **result, xen_vm vm);
524 /**
525 * Get the platform/localtime field of the given VM.
526 */
527 extern bool
528 xen_vm_get_platform_localtime(xen_session *session, bool *result, xen_vm vm);
531 /**
532 * Get the platform/clock_offset field of the given VM.
533 */
534 extern bool
535 xen_vm_get_platform_clock_offset(xen_session *session, bool *result, xen_vm vm);
538 /**
539 * Get the platform/enable_audio field of the given VM.
540 */
541 extern bool
542 xen_vm_get_platform_enable_audio(xen_session *session, bool *result, xen_vm vm);
545 /**
546 * Get the PCI_bus field of the given VM.
547 */
548 extern bool
549 xen_vm_get_pci_bus(xen_session *session, char **result, xen_vm vm);
552 /**
553 * Get the tools_version field of the given VM.
554 */
555 extern bool
556 xen_vm_get_tools_version(xen_session *session, xen_string_string_map **result, xen_vm vm);
559 /**
560 * Get the other_config field of the given VM.
561 */
562 extern bool
563 xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, xen_vm vm);
566 /**
567 * Get the is_control_domain field of the given VM.
568 */
569 extern bool
570 xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
573 /**
574 * Get the metrics field of the given VM.
575 */
576 extern bool
577 xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm);
580 /**
581 * Set the name/label field of the given VM.
582 */
583 extern bool
584 xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label);
587 /**
588 * Set the name/description field of the given VM.
589 */
590 extern bool
591 xen_vm_set_name_description(xen_session *session, xen_vm vm, char *description);
594 /**
595 * Set the user_version field of the given VM.
596 */
597 extern bool
598 xen_vm_set_user_version(xen_session *session, xen_vm vm, int64_t user_version);
601 /**
602 * Set the is_a_template field of the given VM.
603 */
604 extern bool
605 xen_vm_set_is_a_template(xen_session *session, xen_vm vm, bool is_a_template);
608 /**
609 * Set the auto_power_on field of the given VM.
610 */
611 extern bool
612 xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
615 /**
616 * Set the memory/static_max field of the given VM.
617 */
618 extern bool
619 xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max);
622 /**
623 * Set the memory/dynamic_max field of the given VM.
624 */
625 extern bool
626 xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max);
629 /**
630 * Set the memory/dynamic_min field of the given VM.
631 */
632 extern bool
633 xen_vm_set_memory_dynamic_min(xen_session *session, xen_vm vm, int64_t dynamic_min);
636 /**
637 * Set the memory/static_min field of the given VM.
638 */
639 extern bool
640 xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min);
643 /**
644 * Set the VCPUs/policy field of the given VM.
645 */
646 extern bool
647 xen_vm_set_vcpus_policy(xen_session *session, xen_vm vm, char *policy);
650 /**
651 * Set the VCPUs/params field of the given VM.
652 */
653 extern bool
654 xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params);
657 /**
658 * Add the given key-value pair to the VCPUs/params field of the given
659 * VM.
660 */
661 extern bool
662 xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value);
665 /**
666 * Remove the given key and its corresponding value from the
667 * VCPUs/params field of the given VM. If the key is not in that Map, then do
668 * nothing.
669 */
670 extern bool
671 xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key);
674 /**
675 * Set the VCPUs/max field of the given VM.
676 */
677 extern bool
678 xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max);
681 /**
682 * Set the VCPUs/at_startup field of the given VM.
683 */
684 extern bool
685 xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup);
688 /**
689 * Set the actions/after_shutdown field of the given VM.
690 */
691 extern bool
692 xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown);
695 /**
696 * Set the actions/after_reboot field of the given VM.
697 */
698 extern bool
699 xen_vm_set_actions_after_reboot(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_reboot);
702 /**
703 * Set the actions/after_crash field of the given VM.
704 */
705 extern bool
706 xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_crash_behaviour after_crash);
709 /**
710 * Set the PV/bootloader field of the given VM.
711 */
712 extern bool
713 xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader);
716 /**
717 * Set the PV/kernel field of the given VM.
718 */
719 extern bool
720 xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel);
723 /**
724 * Set the PV/ramdisk field of the given VM.
725 */
726 extern bool
727 xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk);
730 /**
731 * Set the PV/args field of the given VM.
732 */
733 extern bool
734 xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args);
737 /**
738 * Set the PV/bootloader_args field of the given VM.
739 */
740 extern bool
741 xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args);
744 /**
745 * Set the HVM/boot_policy field of the given VM.
746 */
747 extern bool
748 xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy);
751 /**
752 * Set the HVM/boot_params field of the given VM.
753 */
754 extern bool
755 xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params);
758 /**
759 * Add the given key-value pair to the HVM/boot_params field of the
760 * given VM.
761 */
762 extern bool
763 xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value);
766 /**
767 * Remove the given key and its corresponding value from the
768 * HVM/boot_params field of the given VM. If the key is not in that Map, then
769 * do nothing.
770 */
771 extern bool
772 xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key);
775 /**
776 * Set the platform/std_VGA field of the given VM.
777 */
778 extern bool
779 xen_vm_set_platform_std_vga(xen_session *session, xen_vm vm, bool std_vga);
782 /**
783 * Set the platform/serial field of the given VM.
784 */
785 extern bool
786 xen_vm_set_platform_serial(xen_session *session, xen_vm vm, char *serial);
789 /**
790 * Set the platform/localtime field of the given VM.
791 */
792 extern bool
793 xen_vm_set_platform_localtime(xen_session *session, xen_vm vm, bool localtime);
796 /**
797 * Set the platform/clock_offset field of the given VM.
798 */
799 extern bool
800 xen_vm_set_platform_clock_offset(xen_session *session, xen_vm vm, bool clock_offset);
803 /**
804 * Set the platform/enable_audio field of the given VM.
805 */
806 extern bool
807 xen_vm_set_platform_enable_audio(xen_session *session, xen_vm vm, bool enable_audio);
810 /**
811 * Set the other_config field of the given VM.
812 */
813 extern bool
814 xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map *other_config);
817 /**
818 * Add the given key-value pair to the other_config field of the given
819 * VM.
820 */
821 extern bool
822 xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char *value);
825 /**
826 * Remove the given key and its corresponding value from the
827 * other_config field of the given VM. If the key is not in that Map, then do
828 * nothing.
829 */
830 extern bool
831 xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key);
834 /**
835 * Clones the specified VM, making a new VM. Clone automatically
836 * exploits the capabilities of the underlying storage repository in which the
837 * VM's disk images are stored (e.g. Copy on Write). This function can only
838 * be called when the VM is in the Halted State.
839 */
840 extern bool
841 xen_vm_clone(xen_session *session, xen_vm *result, xen_vm vm, char *new_name);
844 /**
845 * Start the specified VM. This function can only be called with the
846 * VM is in the Halted State.
847 */
848 extern bool
849 xen_vm_start(xen_session *session, xen_vm vm, bool start_paused);
852 /**
853 * Pause the specified VM. This can only be called when the specified
854 * VM is in the Running state.
855 */
856 extern bool
857 xen_vm_pause(xen_session *session, xen_vm vm);
860 /**
861 * Resume the specified VM. This can only be called when the specified
862 * VM is in the Paused state.
863 */
864 extern bool
865 xen_vm_unpause(xen_session *session, xen_vm vm);
868 /**
869 * Attempt to cleanly shutdown the specified VM. (Note: this may not be
870 * supported---e.g. if a guest agent is not installed).
871 *
872 * Once shutdown has been completed perform poweroff action specified in guest
873 * configuration.
874 *
875 * This can only be called when the specified VM is in the Running state.
876 */
877 extern bool
878 xen_vm_clean_shutdown(xen_session *session, xen_vm vm);
881 /**
882 * Attempt to cleanly shutdown the specified VM (Note: this may not be
883 * supported---e.g. if a guest agent is not installed).
884 *
885 * Once shutdown has been completed perform reboot action specified in guest
886 * configuration.
887 *
888 * This can only be called when the specified VM is in the Running state.
889 */
890 extern bool
891 xen_vm_clean_reboot(xen_session *session, xen_vm vm);
894 /**
895 * Stop executing the specified VM without attempting a clean shutdown.
896 * Then perform poweroff action specified in VM configuration.
897 */
898 extern bool
899 xen_vm_hard_shutdown(xen_session *session, xen_vm vm);
902 /**
903 * Stop executing the specified VM without attempting a clean shutdown.
904 * Then perform reboot action specified in VM configuration
905 */
906 extern bool
907 xen_vm_hard_reboot(xen_session *session, xen_vm vm);
910 /**
911 * Suspend the specified VM to disk. This can only be called when the
912 * specified VM is in the Running state.
913 */
914 extern bool
915 xen_vm_suspend(xen_session *session, xen_vm vm);
918 /**
919 * Awaken the specified VM and resume it. This can only be called when
920 * the specified VM is in the Suspended state.
921 */
922 extern bool
923 xen_vm_resume(xen_session *session, xen_vm vm, bool start_paused);
926 /**
927 * Return a list of all the VMs known to the system.
928 */
929 extern bool
930 xen_vm_get_all(xen_session *session, struct xen_vm_set **result);
933 #endif