Permalink
Browse files

controller: change argument type to int (how many VMs to start)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
  • Loading branch information...
1 parent a0dbcc8 commit 2747d44b306dfcf693d692adfd9b2534675df974 David Scott committed Feb 4, 2014
Showing with 4 additions and 5 deletions.
  1. +1 −1 dbus/vm/controller.xml
  2. +3 −4 dbus/vm/ocaml/simulator.ml
View
@@ -1,7 +1,7 @@
<node>
<interface name="org.xenserver.api.controller">
<method name="start_multiple">
- <arg name="which" type="s" direction="in"/>
+ <arg name="how_many" type="i" direction="in"/>
<arg name="time" type="s" direction="out"/>
</method>
<method name="stop_multiple">
@@ -3,7 +3,6 @@ open Lwt_io
let volumes_per_vm = 6
let networks_per_vm = 6
-let total_vms = 5
let debug_logging = ref false
@@ -20,15 +19,15 @@ let log fmt =
then Printf.fprintf Pervasives.stderr "%s\n%!" s
) fmt
-let controller_start_multiple which =
- log "controller_start_multiple %s" which;
+let controller_start_multiple how_many =
+ log "controller_start_multiple %ld" how_many;
lwt bus = OBus_bus.session () in
let vm = OBus_proxy.make (OBus_peer.make bus "org.xenserver.vm") ["org"; "xenserver"; "vm"] in
let start = Unix.gettimeofday () in
lwt () = repeat
(fun i ->
OBus_method.call Vm.Org_xenserver_api_vm.m_start vm (string_of_int i)
- ) total_vms in
+ ) (Int32.to_int how_many) in
let time = Unix.gettimeofday () -. start in
return (string_of_float time)

0 comments on commit 2747d44

Please sign in to comment.