# HG changeset patch
# User Jonathan Knowles <[email protected]>
# Date 1264782388 0
# Node ID ba381a270aa44fb8536165e9703f1327f83e60b8
# Parent  46461dc60f7b6a35ec0cc9dcfef7e76adce51f65
[CA-31705] Improves error handling within vm-memory-target-wait.

Inlines two calls to an error handling function that will shortly become 
redundant.

Signed-off-by: Jonathan Knowles <[email protected]>

diff -r 46461dc60f7b -r ba381a270aa4 ocaml/xapi/xapi_vm_helpers.ml
--- a/ocaml/xapi/xapi_vm_helpers.ml     Fri Jan 29 16:22:53 2010 +0000
+++ b/ocaml/xapi/xapi_vm_helpers.ml     Fri Jan 29 16:26:28 2010 +0000
@@ -649,13 +649,15 @@
        ?(timeout_seconds = wait_memory_target_timeout_seconds)
        ?(tolerance_bytes = wait_memory_target_tolerance_bytes)
        () =
-       let raise_error error = raise (Api_errors.Server_error (
-               error, [Ref.string_of (Context.get_task_id __context)])) in
        let rec wait accumulated_wait_time_seconds =
                if accumulated_wait_time_seconds > 
wait_memory_target_timeout_seconds
-                       then raise_error 
Api_errors.vm_memory_target_wait_timeout;
+                       then raise (Api_errors.Server_error
+                               (Api_errors.vm_memory_target_wait_timeout,
+                               [Ref.string_of (Context.get_task_id 
__context)]));
                if TaskHelper.is_cancelling ~__context
-                       then raise_error Api_errors.task_cancelled;
+                       then raise (Api_errors.Server_error
+                               (Api_errors.task_cancelled,
+                               [Ref.string_of (Context.get_task_id 
__context)]));
                (* Fetch up-to-date value of memory_actual via a hypercall to 
Xen. *)
                let domain_id = Helpers.domid_of_vm ~__context ~self in
                let domain_info = Vmopshelpers.with_xc
1 file changed, 6 insertions(+), 4 deletions(-)
ocaml/xapi/xapi_vm_helpers.ml |   10 ++++++----


# HG changeset patch
# User Jonathan Knowles <[email protected]>
# Date 1264782388 0
# Node ID ba381a270aa44fb8536165e9703f1327f83e60b8
# Parent  46461dc60f7b6a35ec0cc9dcfef7e76adce51f65
[CA-31705] Improves error handling within vm-memory-target-wait.

Inlines two calls to an error handling function that will shortly become redundant.

Signed-off-by: Jonathan Knowles <[email protected]>

diff -r 46461dc60f7b -r ba381a270aa4 ocaml/xapi/xapi_vm_helpers.ml
--- a/ocaml/xapi/xapi_vm_helpers.ml	Fri Jan 29 16:22:53 2010 +0000
+++ b/ocaml/xapi/xapi_vm_helpers.ml	Fri Jan 29 16:26:28 2010 +0000
@@ -649,13 +649,15 @@
 	?(timeout_seconds = wait_memory_target_timeout_seconds)
 	?(tolerance_bytes = wait_memory_target_tolerance_bytes)
 	() =
-	let raise_error error = raise (Api_errors.Server_error (
-		error, [Ref.string_of (Context.get_task_id __context)])) in
 	let rec wait accumulated_wait_time_seconds =
 		if accumulated_wait_time_seconds > wait_memory_target_timeout_seconds
-			then raise_error Api_errors.vm_memory_target_wait_timeout;
+			then raise (Api_errors.Server_error
+				(Api_errors.vm_memory_target_wait_timeout,
+				[Ref.string_of (Context.get_task_id __context)]));
 		if TaskHelper.is_cancelling ~__context
-			then raise_error Api_errors.task_cancelled;
+			then raise (Api_errors.Server_error
+				(Api_errors.task_cancelled,
+				[Ref.string_of (Context.get_task_id __context)]));
 		(* Fetch up-to-date value of memory_actual via a hypercall to Xen. *)
 		let domain_id = Helpers.domid_of_vm ~__context ~self in
 		let domain_info = Vmopshelpers.with_xc
_______________________________________________
xen-api mailing list
[email protected]
http://lists.xensource.com/mailman/listinfo/xen-api

Reply via email to