diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-06-13 11:27:08 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-06-13 11:27:08 +0100 |
commit | 876bffbc17876668d06f01bf899b981511a40fc3 (patch) | |
tree | 5b2830d714c971db9ebc0a5a81541f1a896a6394 /tools/libxen/src | |
parent | f63ebd213eaa5eb45139cf23390d23f6743ec27b (diff) | |
download | xen-876bffbc17876668d06f01bf899b981511a40fc3.tar.gz xen-876bffbc17876668d06f01bf899b981511a40fc3.tar.bz2 xen-876bffbc17876668d06f01bf899b981511a40fc3.zip |
xenapi: Fix segfault in libxenapi.
When calling xen_vbd_set_mode(), libxenapi attempted to convert enum
mode parameter to a string twice - resulting in segfault. Removed
first conversion since conversion is taking place in
marshalling/demarshalling layer. Fixed similar double enum conversion
in other places as well.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Diffstat (limited to 'tools/libxen/src')
-rw-r--r-- | tools/libxen/src/xen_vbd.c | 4 | ||||
-rw-r--r-- | tools/libxen/src/xen_vm.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/libxen/src/xen_vbd.c b/tools/libxen/src/xen_vbd.c index 85b034b45a..9efbca4f58 100644 --- a/tools/libxen/src/xen_vbd.c +++ b/tools/libxen/src/xen_vbd.c @@ -463,7 +463,7 @@ xen_vbd_set_mode(xen_session *session, xen_vbd vbd, enum xen_vbd_mode mode) { .type = &abstract_type_string, .u.string_val = vbd }, { .type = &xen_vbd_mode_abstract_type_, - .u.string_val = xen_vbd_mode_to_string(mode) } + .u.enum_val = mode } }; xen_call_(session, "VBD.set_mode", param_values, 2, NULL, NULL); @@ -479,7 +479,7 @@ xen_vbd_set_type(xen_session *session, xen_vbd vbd, enum xen_vbd_type type) { .type = &abstract_type_string, .u.string_val = vbd }, { .type = &xen_vbd_type_abstract_type_, - .u.string_val = xen_vbd_type_to_string(type) } + .u.enum_val = type } }; xen_call_(session, "VBD.set_type", param_values, 2, NULL, NULL); diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c index 495103c9a9..d3406ab2ec 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -1142,7 +1142,7 @@ xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_n { .type = &abstract_type_string, .u.string_val = vm }, { .type = &xen_on_normal_exit_abstract_type_, - .u.string_val = xen_on_normal_exit_to_string(after_shutdown) } + .u.enum_val = after_shutdown } }; xen_call_(session, "VM.set_actions_after_shutdown", param_values, 2, NULL, NULL); @@ -1158,7 +1158,7 @@ xen_vm_set_actions_after_reboot(xen_session *session, xen_vm vm, enum xen_on_nor { .type = &abstract_type_string, .u.string_val = vm }, { .type = &xen_on_normal_exit_abstract_type_, - .u.string_val = xen_on_normal_exit_to_string(after_reboot) } + .u.enum_val = after_reboot } }; xen_call_(session, "VM.set_actions_after_reboot", param_values, 2, NULL, NULL); @@ -1174,7 +1174,7 @@ xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_cras { .type = &abstract_type_string, .u.string_val = vm }, { .type = &xen_on_crash_behaviour_abstract_type_, - .u.string_val = xen_on_crash_behaviour_to_string(after_crash) } + .u.enum_val = after_crash } }; xen_call_(session, "VM.set_actions_after_crash", param_values, 2, NULL, NULL); |