aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfehlig@jfehlig2.provo.novell.com <jfehlig@jfehlig2.provo.novell.com>2006-12-13 18:06:48 -0700
committerjfehlig@jfehlig2.provo.novell.com <jfehlig@jfehlig2.provo.novell.com>2006-12-13 18:06:48 -0700
commit160ed4756b5c4be2b144f30b0e6ad221494cfdce (patch)
tree85d96d3374997b79255e85a4055af207c63e917b
parentd2cd19a8b26955f53e1e0245e6681db55aa5de97 (diff)
downloadxen-160ed4756b5c4be2b144f30b0e6ad221494cfdce.tar.gz
xen-160ed4756b5c4be2b144f30b0e6ad221494cfdce.tar.bz2
xen-160ed4756b5c4be2b144f30b0e6ad221494cfdce.zip
Fix VM.get_power_state API. On the xend side an integer representation of the power state was being returned instead of a string representation as specified by the XenAPI spec.
On the c-bindings side the marshalling code converts the string representation to an enum value. A subsequent attempt to convert the enum from a string to an enum was causing a seg fault. Signed-off-by: Jim Fehlig <jfehlig@novell.com>
-rw-r--r--tools/libxen/include/xen_internal.h1
-rw-r--r--tools/libxen/src/xen_vm.c2
-rw-r--r--tools/python/xen/xend/XendAPI.py2
3 files changed, 1 insertions, 4 deletions
diff --git a/tools/libxen/include/xen_internal.h b/tools/libxen/include/xen_internal.h
index 043c4053f8..324fb88428 100644
--- a/tools/libxen/include/xen_internal.h
+++ b/tools/libxen/include/xen_internal.h
@@ -128,7 +128,6 @@ xen_enum_lookup_(xen_session *session, const char *str,
xen_enum_lookup_(session__, str__, lookup_table__, \
sizeof(lookup_table__) / \
sizeof(lookup_table__[0])) \
- \
#define XEN_ALLOC(type__) \
type__ * \
diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c
index 1914b86959..9d96a0c233 100644
--- a/tools/libxen/src/xen_vm.c
+++ b/tools/libxen/src/xen_vm.c
@@ -324,9 +324,7 @@ xen_vm_get_power_state(xen_session *session, enum xen_vm_power_state *result, xe
};
abstract_type result_type = xen_vm_power_state_abstract_type_;
- char *result_str = NULL;
XEN_CALL_("VM.get_power_state");
- *result = xen_vm_power_state_from_string(session, result_str);
return session->ok;
}
diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py
index 62b36a738b..c43ae75976 100644
--- a/tools/python/xen/xend/XendAPI.py
+++ b/tools/python/xen/xend/XendAPI.py
@@ -669,7 +669,7 @@ class XendAPI:
# attributes (ro)
def VM_get_power_state(self, session, vm_ref):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_success(dom.state)
+ return xen_api_success(dom.get_power_state())
def VM_get_resident_on(self, session, vm_ref):
return xen_api_success(XendNode.instance().uuid)