From: Rok Strnisa Date: Wed, 26 Jan 2011 17:39:05 +0000 (+0000) Subject: Removing warnings, first wave. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=13a6896639ddd3d4059ad775c49aacacb3b79cdb;p=xcp%2Fxen-api.git Removing warnings, first wave. Signed-off-by: Rok Strnisa --- diff --git a/ocaml/idl/ocaml_backend/exnHelper.ml b/ocaml/idl/ocaml_backend/exnHelper.ml index 7c21d211..aa2f0635 100644 --- a/ocaml/idl/ocaml_backend/exnHelper.ml +++ b/ocaml/idl/ocaml_backend/exnHelper.ml @@ -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 ] diff --git a/ocaml/multipathrt/iscsi_utils.ml b/ocaml/multipathrt/iscsi_utils.ml index e4ba43b0..33b06282 100644 --- a/ocaml/multipathrt/iscsi_utils.ml +++ b/ocaml/multipathrt/iscsi_utils.ml @@ -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"; diff --git a/ocaml/multipathrt/utils.ml b/ocaml/multipathrt/utils.ml index 40b1dde6..85cda94c 100644 --- a/ocaml/multipathrt/utils.ml +++ b/ocaml/multipathrt/utils.ml @@ -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 () diff --git a/ocaml/perftest/createVM.ml b/ocaml/perftest/createVM.ml index 39893876..e32bce85 100644 --- a/ocaml/perftest/createVM.ml +++ b/ocaml/perftest/createVM.ml @@ -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; diff --git a/ocaml/perftest/createpool.ml b/ocaml/perftest/createpool.ml index b9f7b4ba..64cd7669 100644 --- a/ocaml/perftest/createpool.ml +++ b/ocaml/perftest/createpool.ml @@ -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 -> diff --git a/ocaml/perftest/perfutil.ml b/ocaml/perftest/perfutil.ml index 688ae79a..cb980f02 100644 --- a/ocaml/perftest/perfutil.ml +++ b/ocaml/perftest/perfutil.ml @@ -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 = diff --git a/ocaml/xapi/quicktest.ml b/ocaml/xapi/quicktest.ml index 91f06b16..e823a08b 100644 --- a/ocaml/xapi/quicktest.ml +++ b/ocaml/xapi/quicktest.ml @@ -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'; diff --git a/ocaml/xapi/xapi_ha_vm_failover.ml b/ocaml/xapi/xapi_ha_vm_failover.ml index a65a93f4..00770a01 100644 --- a/ocaml/xapi/xapi_ha_vm_failover.ml +++ b/ocaml/xapi/xapi_ha_vm_failover.ml @@ -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 ();