diff options
author | Ewan Mellor <ewan@xensource.com> | 2007-01-30 00:10:05 +0000 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2007-01-30 00:10:05 +0000 |
commit | ff9fb017b3be963809ff16dd9df0e153526af6bd (patch) | |
tree | 27bdd553fad95b04624412f73aabb30b47873002 /tools/libxen/src | |
parent | 0c787417a5aa5c22cc1929a6d4f5f5eaa4f88e1c (diff) | |
download | xen-ff9fb017b3be963809ff16dd9df0e153526af6bd.tar.gz xen-ff9fb017b3be963809ff16dd9df0e153526af6bd.tar.bz2 xen-ff9fb017b3be963809ff16dd9df0e153526af6bd.zip |
Remove the CPU feature handling, unimplementable as it stands.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen/src')
-rw-r--r-- | tools/libxen/src/xen_cpu_feature.c | 143 | ||||
-rw-r--r-- | tools/libxen/src/xen_host_cpu.c | 23 | ||||
-rw-r--r-- | tools/libxen/src/xen_vm.c | 182 |
3 files changed, 0 insertions, 348 deletions
diff --git a/tools/libxen/src/xen_cpu_feature.c b/tools/libxen/src/xen_cpu_feature.c deleted file mode 100644 index 6f19f32704..0000000000 --- a/tools/libxen/src/xen_cpu_feature.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2006, XenSource Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <string.h> - -#include "xen_internal.h" -#include "xen_cpu_feature.h" -#include "xen_cpu_feature_internal.h" - - -/* - * Maintain this in the same order as the enum declaration! - */ -static const char *lookup_table[] = -{ - "FPU", - "VME", - "DE", - "PSE", - "TSC", - "MSR", - "PAE", - "MCE", - "CX8", - "APIC", - "SEP", - "MTRR", - "PGE", - "MCA", - "CMOV", - "PAT", - "PSE36", - "PN", - "CLFLSH", - "DTES", - "ACPI", - "MMX", - "FXSR", - "XMM", - "XMM2", - "SELFSNOOP", - "HT", - "ACC", - "IA64", - "SYSCALL", - "MP", - "NX", - "MMXEXT", - "LM", - "THREEDNOWEXT", - "THREEDNOW", - "RECOVERY", - "LONGRUN", - "LRTI", - "CXMMX", - "K6_MTRR", - "CYRIX_ARR", - "CENTAUR_MCR", - "K8", - "K7", - "P3", - "P4", - "CONSTANT_TSC", - "FXSAVE_LEAK", - "XMM3", - "MWAIT", - "DSCPL", - "EST", - "TM2", - "CID", - "CX16", - "XTPR", - "XSTORE", - "XSTORE_EN", - "XCRYPT", - "XCRYPT_EN", - "LAHF_LM", - "CMP_LEGACY", - "VMX" -}; - - -extern xen_cpu_feature_set * -xen_cpu_feature_set_alloc(size_t size) -{ - return calloc(1, sizeof(xen_cpu_feature_set) + - size * sizeof(enum xen_cpu_feature)); -} - - -extern void -xen_cpu_feature_set_free(xen_cpu_feature_set *set) -{ - free(set); -} - - -const char * -xen_cpu_feature_to_string(enum xen_cpu_feature val) -{ - return lookup_table[val]; -} - - -extern enum xen_cpu_feature -xen_cpu_feature_from_string(xen_session *session, const char *str) -{ - return ENUM_LOOKUP(session, str, lookup_table); -} - - -const abstract_type xen_cpu_feature_abstract_type_ = - { - .typename = ENUM, - .enum_marshaller = - (const char *(*)(int))&xen_cpu_feature_to_string, - .enum_demarshaller = - (int (*)(xen_session *, const char *))&xen_cpu_feature_from_string - }; - - -const abstract_type xen_cpu_feature_set_abstract_type_ = - { - .typename = SET, - .child = &xen_cpu_feature_abstract_type_ - }; - - diff --git a/tools/libxen/src/xen_host_cpu.c b/tools/libxen/src/xen_host_cpu.c index ff73dcd9b9..1300ce0e43 100644 --- a/tools/libxen/src/xen_host_cpu.c +++ b/tools/libxen/src/xen_host_cpu.c @@ -21,8 +21,6 @@ #include <stdlib.h> #include "xen_common.h" -#include "xen_cpu_feature.h" -#include "xen_cpu_feature_internal.h" #include "xen_host.h" #include "xen_host_cpu.h" #include "xen_internal.h" @@ -57,9 +55,6 @@ static const struct_member xen_host_cpu_record_struct_members[] = { .key = "modelname", .type = &abstract_type_string, .offset = offsetof(xen_host_cpu_record, modelname) }, - { .key = "features", - .type = &xen_cpu_feature_set_abstract_type_, - .offset = offsetof(xen_host_cpu_record, features) }, { .key = "utilisation", .type = &abstract_type_float, .offset = offsetof(xen_host_cpu_record, utilisation) } @@ -87,7 +82,6 @@ xen_host_cpu_record_free(xen_host_cpu_record *record) xen_host_record_opt_free(record->host); free(record->vendor); free(record->modelname); - xen_cpu_feature_set_free(record->features); free(record); } @@ -247,23 +241,6 @@ xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu hos bool -xen_host_cpu_get_features(xen_session *session, struct xen_cpu_feature_set **result, xen_host_cpu host_cpu) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = host_cpu } - }; - - abstract_type result_type = xen_cpu_feature_set_abstract_type_; - - *result = NULL; - XEN_CALL_("host_cpu.get_features"); - return session->ok; -} - - -bool xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu) { abstract_value param_values[] = diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c index 08f4a6098e..83e107e858 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -22,8 +22,6 @@ #include "xen_common.h" #include "xen_console.h" -#include "xen_cpu_feature.h" -#include "xen_cpu_feature_internal.h" #include "xen_host.h" #include "xen_int_float_map.h" #include "xen_internal.h" @@ -99,18 +97,6 @@ static const struct_member xen_vm_record_struct_members[] = { .key = "VCPUs_utilisation", .type = &abstract_type_int_float_map, .offset = offsetof(xen_vm_record, vcpus_utilisation) }, - { .key = "VCPUs_features_required", - .type = &xen_cpu_feature_set_abstract_type_, - .offset = offsetof(xen_vm_record, vcpus_features_required) }, - { .key = "VCPUs_features_can_use", - .type = &xen_cpu_feature_set_abstract_type_, - .offset = offsetof(xen_vm_record, vcpus_features_can_use) }, - { .key = "VCPUs_features_force_on", - .type = &xen_cpu_feature_set_abstract_type_, - .offset = offsetof(xen_vm_record, vcpus_features_force_on) }, - { .key = "VCPUs_features_force_off", - .type = &xen_cpu_feature_set_abstract_type_, - .offset = offsetof(xen_vm_record, vcpus_features_force_off) }, { .key = "actions_after_shutdown", .type = &xen_on_normal_exit_abstract_type_, .offset = offsetof(xen_vm_record, actions_after_shutdown) }, @@ -204,10 +190,6 @@ xen_vm_record_free(xen_vm_record *record) free(record->vcpus_policy); free(record->vcpus_params); xen_int_float_map_free(record->vcpus_utilisation); - xen_cpu_feature_set_free(record->vcpus_features_required); - xen_cpu_feature_set_free(record->vcpus_features_can_use); - xen_cpu_feature_set_free(record->vcpus_features_force_on); - xen_cpu_feature_set_free(record->vcpus_features_force_off); xen_console_record_opt_set_free(record->consoles); xen_vif_record_opt_set_free(record->vifs); xen_vbd_record_opt_set_free(record->vbds); @@ -576,74 +558,6 @@ xen_vm_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, x bool -xen_vm_get_vcpus_features_required(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm } - }; - - abstract_type result_type = xen_cpu_feature_set_abstract_type_; - - *result = NULL; - XEN_CALL_("VM.get_VCPUs_features_required"); - return session->ok; -} - - -bool -xen_vm_get_vcpus_features_can_use(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm } - }; - - abstract_type result_type = xen_cpu_feature_set_abstract_type_; - - *result = NULL; - XEN_CALL_("VM.get_VCPUs_features_can_use"); - return session->ok; -} - - -bool -xen_vm_get_vcpus_features_force_on(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm } - }; - - abstract_type result_type = xen_cpu_feature_set_abstract_type_; - - *result = NULL; - XEN_CALL_("VM.get_VCPUs_features_force_on"); - return session->ok; -} - - -bool -xen_vm_get_vcpus_features_force_off(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm } - }; - - abstract_type result_type = xen_cpu_feature_set_abstract_type_; - - *result = NULL; - XEN_CALL_("VM.get_VCPUs_features_force_off"); - return session->ok; -} - - -bool xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm) { abstract_value param_values[] = @@ -1166,102 +1080,6 @@ xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number) bool -xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_on) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &xen_cpu_feature_set_abstract_type_, - .u.set_val = (arbitrary_set *)force_on } - }; - - xen_call_(session, "VM.set_VCPUs_features_force_on", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool -xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &xen_cpu_feature_abstract_type_, - .u.string_val = xen_cpu_feature_to_string(value) } - }; - - xen_call_(session, "VM.add_VCPUs_features_force_on", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool -xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &xen_cpu_feature_abstract_type_, - .u.string_val = xen_cpu_feature_to_string(value) } - }; - - xen_call_(session, "VM.remove_VCPUs_features_force_on", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool -xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_off) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &xen_cpu_feature_set_abstract_type_, - .u.set_val = (arbitrary_set *)force_off } - }; - - xen_call_(session, "VM.set_VCPUs_features_force_off", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool -xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &xen_cpu_feature_abstract_type_, - .u.string_val = xen_cpu_feature_to_string(value) } - }; - - xen_call_(session, "VM.add_VCPUs_features_force_off", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool -xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value) -{ - abstract_value param_values[] = - { - { .type = &abstract_type_string, - .u.string_val = vm }, - { .type = &xen_cpu_feature_abstract_type_, - .u.string_val = xen_cpu_feature_to_string(value) } - }; - - xen_call_(session, "VM.remove_VCPUs_features_force_off", param_values, 2, NULL, NULL); - return session->ok; -} - - -bool xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown) { abstract_value param_values[] = |