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 4 of 4] CA-35397: reduce the number of calls to domain_

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 4 of 4] CA-35397: reduce the number of calls to domain_getinfo by looking up a VM reference by UUID
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 13:57:52 +0000
Delivery-date: Mon, 30 Nov 2009 05:56:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1259589468@xxxxxxxxxxxxxxxxxxxx>
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 David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259589194 0
# Node ID 87733f43712b5e3653d0651f10e34b9634f79c27
# Parent  73883a5db626d9861185db38ba14fe667289d589
CA-35397: reduce the number of calls to domain_getinfo by looking up a VM 
reference by UUID.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 73883a5db626 -r 87733f43712b ocaml/xapi/xapi_guest_agent.ml
--- a/ocaml/xapi/xapi_guest_agent.ml    Mon Nov 30 13:53:13 2009 +0000
+++ b/ocaml/xapi/xapi_guest_agent.ml    Mon Nov 30 13:53:14 2009 +0000
@@ -271,7 +271,7 @@
                            debug "Marking as alive!";
                            (* Mark guest as alive! *)
                            dead_domains := IntSet.remove domid !dead_domains;
-                           let vm = Vmopshelpers.vm_of_domid ~__context domid 
in
+                               let vm = Db.VM.get_by_uuid ~__context 
~uuid:(Uuid.string_of_uuid (Uuid.uuid_of_int_array dom.Xc.handle)) in
                            let vm_guest_metrics = Db.VM.get_guest_metrics 
~__context ~self:vm in
                            Db.VM_guest_metrics.set_live ~__context 
~self:vm_guest_metrics ~value:true;
                            debug "Done"
@@ -287,7 +287,7 @@
                            debug "Marking as dead!";
                            (* Mark guest as dead! *)
                            dead_domains := IntSet.add domid !dead_domains;
-                           let vm = Vmopshelpers.vm_of_domid ~__context domid 
in
+                               let vm = Db.VM.get_by_uuid ~__context 
~uuid:(Uuid.string_of_uuid (Uuid.uuid_of_int_array dom.Xc.handle)) in           
                  
                            let vm_guest_metrics = Db.VM.get_guest_metrics 
~__context ~self:vm in
                            Db.VM_guest_metrics.set_live ~__context 
~self:vm_guest_metrics ~value:false;
                            debug "Done"
1 file changed, 2 insertions(+), 2 deletions(-)
ocaml/xapi/xapi_guest_agent.ml |    4 ++--


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

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