# HG changeset patch
# User root@citrico-linux
# Date 1259750515 18000
# Node ID 04717cf5648ad5e85257020a01eaad99ea9e78d2
# Parent  f509339c8f7474c96d3ca6532d2d184443440cc5
Change two wlb checks of the number of recommendations in order to support wlb 2
Signed-off-by:Javier.Alvarez-Valle@citrix.com

diff -r f509339c8f74 -r 04717cf5648a ocaml/xapi/workload_balancing.ml
--- a/ocaml/xapi/workload_balancing.ml	Fri Nov 27 23:00:18 2009 +0000
+++ b/ocaml/xapi/workload_balancing.ml	Wed Dec 02 05:41:55 2009 -0500
@@ -406,7 +406,7 @@
     else
       match recs with 
       | Xml.Element ( _, _, children) ->
-        if ((List.length children) != List.length((Db.Host.get_all ~__context)))
+        if ((List.length children) != List.length((Helpers.get_live_hosts ~__context)))
         then
           raise_malformed_response "VMGetRecommendations" 
             "List of returned reccomendations is not equal to the number of hosts in pool" 
diff -r f509339c8f74 -r 04717cf5648a ocaml/xapi/xapi_vm_helpers.ml
--- a/ocaml/xapi/xapi_vm_helpers.ml	Fri Nov 27 23:00:18 2009 +0000
+++ b/ocaml/xapi/xapi_vm_helpers.ml	Wed Dec 02 05:41:55 2009 -0500
@@ -372,7 +372,7 @@
       with
         | Api_errors.Server_error(x, y) -> Hashtbl.replace recs h (x :: y)
   ) (retrieve_vm_recommendations ~__context ~vm);
-  if ((Hashtbl.length recs) <> (List.length (Db.Host.get_all ~__context)))
+  if ((Hashtbl.length recs) <> (List.length (Helpers.get_live_hosts ~__context)))
   then
     raise_malformed_response' "VMGetRecommendations" 
       "Number of unique recommendations does not match number of potential hosts" "Unknown"
