ia64/xen-unstable

changeset 13004:a874d1170fbc

Implement xen_vm_set_vcpus_number,
xen_vm_{add,remove}_vcpus_features_force{on,off}.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Sat Dec 09 17:16:52 2006 +0000 (2006-12-09)
parents 5eb2f333c981
children dd6bbf10e79a
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 11:13:44 2006 +0000
     1.2 +++ b/tools/libxen/include/xen_vm.h	Sat Dec 09 17:16:52 2006 +0000
     1.3 @@ -607,6 +607,13 @@ xen_vm_set_vcpus_params(xen_session *ses
     1.4  
     1.5  
     1.6  /**
     1.7 + * Set the VCPUs/number field of the given VM.
     1.8 + */
     1.9 +extern bool
    1.10 +xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number);
    1.11 +
    1.12 +
    1.13 +/**
    1.14   * Set the VCPUs/features/force_on field of the given VM.
    1.15   */
    1.16  extern bool
    1.17 @@ -614,6 +621,22 @@ xen_vm_set_vcpus_features_force_on(xen_s
    1.18  
    1.19  
    1.20  /**
    1.21 + * Add the given value to the VCPUs/features/force_on field of the
    1.22 + * given VM.  If the value is already in that Set, then do nothing.
    1.23 + */
    1.24 +extern bool
    1.25 +xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
    1.26 +
    1.27 +
    1.28 +/**
    1.29 + * Remove the given value from the VCPUs/features/force_on field of the
    1.30 + * given VM.  If the value is not in that Set, then do nothing.
    1.31 + */
    1.32 +extern bool
    1.33 +xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
    1.34 +
    1.35 +
    1.36 +/**
    1.37   * Set the VCPUs/features/force_off field of the given VM.
    1.38   */
    1.39  extern bool
    1.40 @@ -621,6 +644,22 @@ xen_vm_set_vcpus_features_force_off(xen_
    1.41  
    1.42  
    1.43  /**
    1.44 + * Add the given value to the VCPUs/features/force_off field of the
    1.45 + * given VM.  If the value is already in that Set, then do nothing.
    1.46 + */
    1.47 +extern bool
    1.48 +xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
    1.49 +
    1.50 +
    1.51 +/**
    1.52 + * Remove the given value from the VCPUs/features/force_off field of
    1.53 + * the given VM.  If the value is not in that Set, then do nothing.
    1.54 + */
    1.55 +extern bool
    1.56 +xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
    1.57 +
    1.58 +
    1.59 +/**
    1.60   * Set the actions/after_shutdown field of the given VM.
    1.61   */
    1.62  extern bool
     2.1 --- a/tools/libxen/src/xen_vm.c	Fri Dec 08 11:13:44 2006 +0000
     2.2 +++ b/tools/libxen/src/xen_vm.c	Sat Dec 09 17:16:52 2006 +0000
     2.3 @@ -1181,6 +1181,22 @@ xen_vm_set_vcpus_params(xen_session *ses
     2.4  
     2.5  
     2.6  bool
     2.7 +xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number)
     2.8 +{
     2.9 +    abstract_value param_values[] =
    2.10 +        {
    2.11 +            { .type = &abstract_type_string,
    2.12 +              .u.string_val = vm },
    2.13 +            { .type = &abstract_type_int,
    2.14 +              .u.int_val = number }
    2.15 +        };
    2.16 +
    2.17 +    xen_call_(session, "VM.set_VCPUs_number", param_values, 2, NULL, NULL);
    2.18 +    return session->ok;
    2.19 +}
    2.20 +
    2.21 +
    2.22 +bool
    2.23  xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_on)
    2.24  {
    2.25      abstract_value param_values[] =
    2.26 @@ -1197,6 +1213,38 @@ xen_vm_set_vcpus_features_force_on(xen_s
    2.27  
    2.28  
    2.29  bool
    2.30 +xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
    2.31 +{
    2.32 +    abstract_value param_values[] =
    2.33 +        {
    2.34 +            { .type = &abstract_type_string,
    2.35 +              .u.string_val = vm },
    2.36 +            { .type = &xen_cpu_feature_abstract_type_,
    2.37 +              .u.string_val = xen_cpu_feature_to_string(value) }
    2.38 +        };
    2.39 +
    2.40 +    xen_call_(session, "VM.add_VCPUs_features_force_on", param_values, 2, NULL, NULL);
    2.41 +    return session->ok;
    2.42 +}
    2.43 +
    2.44 +
    2.45 +bool
    2.46 +xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
    2.47 +{
    2.48 +    abstract_value param_values[] =
    2.49 +        {
    2.50 +            { .type = &abstract_type_string,
    2.51 +              .u.string_val = vm },
    2.52 +            { .type = &xen_cpu_feature_abstract_type_,
    2.53 +              .u.string_val = xen_cpu_feature_to_string(value) }
    2.54 +        };
    2.55 +
    2.56 +    xen_call_(session, "VM.remove_VCPUs_features_force_on", param_values, 2, NULL, NULL);
    2.57 +    return session->ok;
    2.58 +}
    2.59 +
    2.60 +
    2.61 +bool
    2.62  xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_off)
    2.63  {
    2.64      abstract_value param_values[] =
    2.65 @@ -1213,6 +1261,38 @@ xen_vm_set_vcpus_features_force_off(xen_
    2.66  
    2.67  
    2.68  bool
    2.69 +xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
    2.70 +{
    2.71 +    abstract_value param_values[] =
    2.72 +        {
    2.73 +            { .type = &abstract_type_string,
    2.74 +              .u.string_val = vm },
    2.75 +            { .type = &xen_cpu_feature_abstract_type_,
    2.76 +              .u.string_val = xen_cpu_feature_to_string(value) }
    2.77 +        };
    2.78 +
    2.79 +    xen_call_(session, "VM.add_VCPUs_features_force_off", param_values, 2, NULL, NULL);
    2.80 +    return session->ok;
    2.81 +}
    2.82 +
    2.83 +
    2.84 +bool
    2.85 +xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
    2.86 +{
    2.87 +    abstract_value param_values[] =
    2.88 +        {
    2.89 +            { .type = &abstract_type_string,
    2.90 +              .u.string_val = vm },
    2.91 +            { .type = &xen_cpu_feature_abstract_type_,
    2.92 +              .u.string_val = xen_cpu_feature_to_string(value) }
    2.93 +        };
    2.94 +
    2.95 +    xen_call_(session, "VM.remove_VCPUs_features_force_off", param_values, 2, NULL, NULL);
    2.96 +    return session->ok;
    2.97 +}
    2.98 +
    2.99 +
   2.100 +bool
   2.101  xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown)
   2.102  {
   2.103      abstract_value param_values[] =