]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
Removing warnings, first wave.
authorRok Strnisa <rok.strnisa@citrix.com>
Wed, 26 Jan 2011 17:39:05 +0000 (17:39 +0000)
committerRok Strnisa <rok.strnisa@citrix.com>
Wed, 26 Jan 2011 17:39:05 +0000 (17:39 +0000)
Signed-off-by: Rok Strnisa <rok.strnisa@citrix.com>
ocaml/idl/ocaml_backend/exnHelper.ml
ocaml/multipathrt/iscsi_utils.ml
ocaml/multipathrt/utils.ml
ocaml/perftest/createVM.ml
ocaml/perftest/createpool.ml
ocaml/perftest/perfutil.ml
ocaml/xapi/quicktest.ml
ocaml/xapi/xapi_ha_vm_failover.ml

index 7c21d2117553cf2716306cbc551d6febf377f137..aa2f063571250822a78df8115d2a975f975c96f8 100644 (file)
@@ -59,7 +59,7 @@ let error_of_exn e =
 
        | Api_errors.Server_error (e,l) ->
                e,l
-       | Forkhelpers.Spawn_internal_error(stderr, stdout, Unix.WEXITED n) as e ->
+       | Forkhelpers.Spawn_internal_error(stderr, stdout, Unix.WEXITED n) ->
                internal_error, [ Printf.sprintf "Subprocess exitted with unexpected code %d; stdout = [ %s ]; stderr = [ %s ]" n stdout stderr ]
        | Invalid_argument x ->
                internal_error, [ Printf.sprintf "Invalid argument: %s" x ]
index e4ba43b0e257b826efb8ed31a6a5a822a4f81b09..33b06282c220a60f09a167c55aeca5f5aa68a2ff 100644 (file)
@@ -43,7 +43,7 @@ let make_iscsi rpc session_id iscsi_luns num_vifs sr_disk_size key network =
        let newvm = Client.VM.clone rpc session_id template "ISCSI target server" in
        try
                Client.VM.provision rpc session_id newvm;
-               let isovbd = Client.VBD.create rpc session_id newvm iscsi_iso "0" true `RO `CD false false [] "" [] in
+               ignore_VBD(Client.VBD.create rpc session_id newvm iscsi_iso "0" true `RO `CD false false [] "" []);
                let realpool = List.hd (Client.Pool.get_all rpc session_id) in
                let defaultsr = Client.Pool.get_default_SR rpc session_id realpool in
                assert_sr_exists rpc session_id defaultsr "pool's default SR";
@@ -52,7 +52,7 @@ let make_iscsi rpc session_id iscsi_luns num_vifs sr_disk_size key network =
                        let storage_vdi_label = Printf.sprintf "SCSI VDI %d" i in
                        let storage_vdi = Client.VDI.create rpc session_id storage_vdi_label "" defaultsr sr_disk_size `user false false [oc_key,key] [] [] [] in
                        let userdevice = Printf.sprintf "%d" (i+1) in
-                       Client.VBD.create rpc session_id newvm storage_vdi userdevice false `RW `Disk false false [] "" []
+                       ignore_VBD(Client.VBD.create rpc session_id newvm storage_vdi userdevice false `RW `Disk false false [] "" [])
                done;
 
                Client.VM.set_PV_bootloader rpc session_id newvm "pygrub";
index 40b1dde6c9e29280863d7d681b51e220a381b2a3..85cda94ce985764dd3d1f9fbb75e787afa020248 100644 (file)
@@ -16,6 +16,10 @@ open Pervasiveext
 open Listext
 open Client
 
+(* ----------- Ignore functions ----------- *)
+
+let ignore_VBD v = let (_ : API.ref_VBD) = v in ()
+
 (* --------------- Debugging --------------- *)
 
 let stdout_m = Mutex.create () 
index 398938761f999b87195510f158512d7479522acb..e32bce85981d7a1e0fd4b0218239ddce74a341bc 100644 (file)
@@ -52,7 +52,7 @@ let make_iscsi session_id pool network =
                Client.VM.set_PV_bootloader rpc session_id newvm "pygrub";
                Client.VM.set_PV_args rpc session_id newvm (Printf.sprintf "net_ip=%s net_mask=255.255.255.0" (make_iscsi_ip pool));
                Client.VM.set_HVM_boot_policy rpc session_id newvm "";
-               Client.VIF.create rpc session_id "0" network newvm "" 1500L [oc_key,pool.key] "" [];
+               let (_ : API.ref_VIF) = Client.VIF.create rpc session_id "0" network newvm "" 1500L [oc_key,pool.key] "" [] in
                Client.VM.add_to_other_config rpc session_id newvm oc_key pool.key;
                let localhost_uuid = Xapi_inventory.lookup "INSTALLATION_UUID" in
                Client.VM.start_on rpc session_id newvm (Client.Host.get_by_uuid rpc session_id localhost_uuid) false false;
index b9f7b4ba675ba5f548b5a266019a6a42ebf4a2b5..64cd7669b892f9c5d6c036a0601969664bae1552 100644 (file)
@@ -191,7 +191,7 @@ let create_sdk_pool session_id sdkname pool_name key ipbase =
        let interfaces = initialise session_id template pool in
 
        Printf.printf "Creating iSCSI target VM serving %d LUNs\n%!" pool.iscsi_luns;
-       let iscsi_vm = CreateVM.make_iscsi session_id pool (Client.VIF.get_network rpc session_id interfaces.(2)) in
+       let (_ : API.ref_VM option) = CreateVM.make_iscsi session_id pool (Client.VIF.get_network rpc session_id interfaces.(2)) in
 
        debug "Creating %d SDK VMs" pool.hosts;
        let hosts = Array.init pool.hosts (
@@ -389,7 +389,7 @@ let create_sdk_pool session_id sdkname pool_name key ipbase =
        let slave_uuids = List.filter (fun x -> x <> master_uuid) (Array.to_list host_uuids) in
        let host_uuids = Array.of_list (slave_uuids @ [ master_uuid ]) in
 
-       let bonds = Array.mapi (fun i host_uuid ->
+       let (_ : API.ref_Bond array array) = Array.mapi (fun i host_uuid ->
                let host_ref = Client.Host.get_by_uuid poolrpc poolses host_uuid in
                let pifs = List.filter (fun pif -> Client.PIF.get_host poolrpc poolses pif = host_ref) pifs in
                Array.init pool.bonds (fun bnum ->
index 688ae79ad46fa4df2e82c460d68bb91b398ad12e..cb980f02ddd75b37fbf9d92255a58d4c858d7d99 100644 (file)
@@ -23,7 +23,6 @@ let rpc xml =
 let remoterpc host xml = 
   Instrumented_xmlrpcclient.do_secure_xml_rpc ~host:host ~version:"1.1" ~port:443 ~path:"/" xml
 
-
 (* Rewrite the provisioning XML fragment to create all disks on a new, specified SR. This is cut-n-pasted from cli_util.ml *)
 let rewrite_provisioning_xml rpc session_id new_vm sr_uuid = 
   let rewrite_xml xml newsrname =
index 91f06b16bbc6b97f467895b067dd124a74302b43..e823a08ba874752995bd16b4b0e1ad5d1e39a2fe 100644 (file)
@@ -463,8 +463,8 @@ let powercycle_test session_id vm =
                        debug test "Cloning suspended VM";
                        let vm' = Client.VM.clone !rpc session_id vm "clone-suspended-test" in
                        debug test "Snapshoting the VM twice";
-                       let snap1 = Client.VM.snapshot !rpc session_id vm' "snap1" in
-                       let snap2 = Client.VM.snapshot !rpc session_id vm' "snap2" in
+                       ignore(Client.VM.snapshot !rpc session_id vm' "snap1");
+                       ignore(Client.VM.snapshot !rpc session_id vm' "snap2");
 
                        debug test "Comparing original, clone VIF configuration";
                        compare_vifs session_id test vm vm';
index a65a93f46764edcd4611d33790e78dcf2138a146..00770a0121f266f1527d651e8b6380c7b02909aa 100644 (file)
@@ -560,7 +560,7 @@ let restart_auto_run_vms ~__context live_set n =
                                                match Random.int 3 with
                                                        | 0 -> raise (Api_errors.Server_error(Api_errors.ha_operation_would_break_failover_plan, []))
                                                        | 1 -> raise (Api_errors.Server_error("FIST: unexpected exception", []))
-                                                       | 2 -> () 
+                                                       | _ -> ()
                                        end;
 
                                        (* If we tried before and failed, don't retry again within 2 minutes *)
@@ -582,7 +582,7 @@ let restart_auto_run_vms ~__context live_set n =
                                        | Api_errors.Server_error(code, params) when code = Api_errors.ha_operation_would_break_failover_plan ->
                                                (* This should never happen since the planning code would always allow the restart of a protected VM... *)
                                                error "Caught exception HA_OPERATION_WOULD_BREAK_FAILOVER_PLAN: setting pool as overcommitted and retrying";
-                                               mark_pool_as_overcommitted ~__context;
+                                               ignore_bool(mark_pool_as_overcommitted ~__context);
                                                begin
                                                        try
                                                                go ();