ia64/xen-unstable

changeset 13001:737c1c11497d

Implement the VM.auto_power_on field.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Dec 08 10:59:18 2006 +0000 (2006-12-08)
parents 5fc7ac854bce
children 8b7b61fa89e2
files tools/libxen/include/xen_vm.h tools/libxen/src/xen_vm.c
line diff
     1.1 --- a/tools/libxen/include/xen_vm.h	Fri Dec 08 10:57:14 2006 +0000
     1.2 +++ b/tools/libxen/include/xen_vm.h	Fri Dec 08 10:59:18 2006 +0000
     1.3 @@ -79,6 +79,7 @@ typedef struct xen_vm_record
     1.4      char *name_description;
     1.5      int64_t user_version;
     1.6      bool is_a_template;
     1.7 +    bool auto_power_on;
     1.8      struct xen_host_record_opt *resident_on;
     1.9      int64_t memory_static_max;
    1.10      int64_t memory_dynamic_max;
    1.11 @@ -277,6 +278,13 @@ xen_vm_get_is_a_template(xen_session *se
    1.12  
    1.13  
    1.14  /**
    1.15 + * Get the auto_power_on field of the given VM.
    1.16 + */
    1.17 +extern bool
    1.18 +xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
    1.19 +
    1.20 +
    1.21 +/**
    1.22   * Get the resident_on field of the given VM.
    1.23   */
    1.24  extern bool
    1.25 @@ -564,6 +572,13 @@ xen_vm_set_is_a_template(xen_session *se
    1.26  
    1.27  
    1.28  /**
    1.29 + * Set the auto_power_on field of the given VM.
    1.30 + */
    1.31 +extern bool
    1.32 +xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
    1.33 +
    1.34 +
    1.35 +/**
    1.36   * Set the memory/dynamic_max field of the given VM.
    1.37   */
    1.38  extern bool
     2.1 --- a/tools/libxen/src/xen_vm.c	Fri Dec 08 10:57:14 2006 +0000
     2.2 +++ b/tools/libxen/src/xen_vm.c	Fri Dec 08 10:59:18 2006 +0000
     2.3 @@ -67,6 +67,9 @@ static const struct_member xen_vm_record
     2.4          { .key = "is_a_template",
     2.5            .type = &abstract_type_bool,
     2.6            .offset = offsetof(xen_vm_record, is_a_template) },
     2.7 +        { .key = "auto_power_on",
     2.8 +          .type = &abstract_type_bool,
     2.9 +          .offset = offsetof(xen_vm_record, auto_power_on) },
    2.10          { .key = "resident_on",
    2.11            .type = &abstract_type_ref,
    2.12            .offset = offsetof(xen_vm_record, resident_on) },
    2.13 @@ -399,6 +402,22 @@ xen_vm_get_is_a_template(xen_session *se
    2.14  
    2.15  
    2.16  bool
    2.17 +xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm)
    2.18 +{
    2.19 +    abstract_value param_values[] =
    2.20 +        {
    2.21 +            { .type = &abstract_type_string,
    2.22 +              .u.string_val = vm }
    2.23 +        };
    2.24 +
    2.25 +    abstract_type result_type = abstract_type_bool;
    2.26 +
    2.27 +    XEN_CALL_("VM.get_auto_power_on");
    2.28 +    return session->ok;
    2.29 +}
    2.30 +
    2.31 +
    2.32 +bool
    2.33  xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm)
    2.34  {
    2.35      abstract_value param_values[] =
    2.36 @@ -1082,6 +1101,22 @@ xen_vm_set_is_a_template(xen_session *se
    2.37  
    2.38  
    2.39  bool
    2.40 +xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on)
    2.41 +{
    2.42 +    abstract_value param_values[] =
    2.43 +        {
    2.44 +            { .type = &abstract_type_string,
    2.45 +              .u.string_val = vm },
    2.46 +            { .type = &abstract_type_bool,
    2.47 +              .u.bool_val = auto_power_on }
    2.48 +        };
    2.49 +
    2.50 +    xen_call_(session, "VM.set_auto_power_on", param_values, 2, NULL, NULL);
    2.51 +    return session->ok;
    2.52 +}
    2.53 +
    2.54 +
    2.55 +bool
    2.56  xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max)
    2.57  {
    2.58      abstract_value param_values[] =