|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH 4 of 4] CA-35397: reduce the number of calls to domain_
# 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 ++--
xen-api.hg-4.patch
Description: Text Data
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
|
|
|
|