WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 3 of 8] [CA-31705] Improves error handling within vm-me

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 3 of 8] [CA-31705] Improves error handling within vm-memory-target-wait
From: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Mon, 1 Feb 2010 09:19:05 +0000
Delivery-date: Mon, 01 Feb 2010 01:34:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1265015942@radon>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
# Date 1264782551 0
# Node ID a8a2db5d8db352fc4d5cb55621302ce883bfb0a0
# Parent  ba381a270aa44fb8536165e9703f1327f83e60b8
[CA-31705] Improves error handling within vm-memory-target-wait.

Pushes intermediate identifiers into nested scope and removes redundant 
comments.

Signed-off-by: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>

diff -r ba381a270aa4 -r a8a2db5d8db3 ocaml/xapi/xapi_vm_helpers.ml
--- a/ocaml/xapi/xapi_vm_helpers.ml     Fri Jan 29 16:26:28 2010 +0000
+++ b/ocaml/xapi/xapi_vm_helpers.ml     Fri Jan 29 16:29:11 2010 +0000
@@ -658,20 +658,20 @@
                        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
-                       (fun xc -> Xc.domain_getinfo xc domain_id) in
-               let memory_actual_pages = Int64.of_nativeint
-                       domain_info.Xc.total_memory_pages in
-               let memory_actual_kib = Xc.pages_to_kib memory_actual_pages in
-               let memory_actual_bytes = Memory.bytes_of_kib memory_actual_kib 
in
-               (* Fetch up-to-date value of target from xenstore. *)
-               let memory_target_kib = Int64.of_string
-                       (Vmopshelpers.with_xs
-                               (fun xs -> xs.Xs.read
-                                       (xs.Xs.getdomainpath domain_id ^ 
"/memory/target"))) in
-               let memory_target_bytes = Memory.bytes_of_kib memory_target_kib 
in
+               let memory_actual_bytes =
+                       let domain_info = Vmopshelpers.with_xc
+                               (fun xc -> Xc.domain_getinfo xc domain_id) in
+                       let memory_actual_pages = Int64.of_nativeint
+                               domain_info.Xc.total_memory_pages in
+                       let memory_actual_kib = Xc.pages_to_kib 
memory_actual_pages in
+                       Memory.bytes_of_kib memory_actual_kib in
+               let memory_target_bytes =
+                       let memory_target_kib = Int64.of_string
+                               (Vmopshelpers.with_xs
+                                       (fun xs -> xs.Xs.read
+                                               (xs.Xs.getdomainpath domain_id 
^ "/memory/target"))) in
+                       Memory.bytes_of_kib memory_target_kib in
                let difference_bytes = Int64.abs
                        (Int64.sub memory_actual_bytes memory_target_bytes) in
                debug
1 file changed, 13 insertions(+), 13 deletions(-)
ocaml/xapi/xapi_vm_helpers.ml |   26 +++++++++++++-------------


Attachment: xen-api.hg-8.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api