]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
Removed a small subset of compiler warnings.
authorRok Strnisa <rok.strnisa@citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
committerRok Strnisa <rok.strnisa@citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
Signed-off-by: Rok Strnisa <rok.strnisa@citrix.com>
ocaml/idl/dm_api.ml
ocaml/idl/ocaml_backend/event_helper.ml
ocaml/perftest/createVM.ml
ocaml/xapi/events.ml
ocaml/xapi/message_forwarding.ml
ocaml/xapi/xapi_host.ml
ocaml/xapi/xapi_vm.ml
ocaml/xenops/watch.ml
ocaml/xenops/xal.ml

index 407a393601594d29b755409a65b462cdf146d68c..69917bc270023c6f4f64323820273fefca409a9e 100644 (file)
@@ -193,8 +193,8 @@ let check api emergency_calls =
 
   (* Sanity check 7: message parameters must be in increasing order of in_product_since *)
   let are_in_vsn_order ps =
-    let rec getlast l =
-      match l with [x] -> x | x::xs -> getlast xs in
+    let rec getlast l = (* TODO: move to standard library *)
+      match l with [x] -> x | _::xs -> getlast xs | [] -> raise (Invalid_argument "getlast") in
     let release_lt x y = release_leq x y && x<>y in
     let in_since releases = (* been in since the lowest of releases *)
       let rec find_smallest sofar l =
index 8be1483bdcbe508b2b0e702bcc5a3f2a96a6b619..e295bcc636373aac1d146f3f64643ec82613deb8 100644 (file)
@@ -72,4 +72,4 @@ open Pervasiveext
      | "message" ->          Message (Ref.of_string ev.Event_types.reference,API.From.message_t "" xmlrpc)
      | "secret" ->           Secret (Ref.of_string ev.Event_types.reference,API.From.secret_t "" xmlrpc)
      | "vmpp" ->             VMPP (Ref.of_string ev.Event_types.reference,API.From.vMPP_t "" xmlrpc)
-  
+     | _ -> failwith "unknown event type"
index 11f9c641c615044bd173f256815c202a9e276b31..06cfb2ba69b6b1b066116232cbfc1751bdf1f2a9 100644 (file)
@@ -38,7 +38,7 @@ let make_iscsi session_id pool network =
     let template = List.hd (Client.VM.get_by_name_label rpc session_id iscsi_vm_template) in
     let newvm = Client.VM.clone rpc session_id template "ISCSI target server" in
     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
+    let _ (* isovbd *) = Client.VBD.create rpc session_id newvm iscsi_iso "0" true `RO `CD false false [] "" [] in
     let realpool = List.hd (Client.Pool.get_all rpc session_id) in
     let defaultsr = Client.Pool.get_default_SR rpc session_id realpool in
 
@@ -46,7 +46,7 @@ let make_iscsi session_id pool 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,pool.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(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 65878eb023e893ea77388a20b78fa00a2cf8e7a7..2d64e2f006b100d3a35733eb854da459d2d8e2c5 100644 (file)
@@ -497,7 +497,7 @@ let callback_devices ctx domid dev_event =
                       then Hashtbl.replace Monitor.uncooperative_domains domid ()
                       else Hashtbl.remove Monitor.uncooperative_domains domid
                    )
-             | x -> debug "no handler for this event"
+             (*unused case, consider removing: | x -> debug "no handler for this event"*)
                  
            with Vm_corresponding_to_domid_not_in_db domid ->
              error "device_event could not be processed because VM record not in database"
index 2f4e627389c40adff607c2301a5a727de1d45b73..10e2be4856a21cb45f0c7be0241ba09592a1b765 100644 (file)
@@ -17,6 +17,7 @@
  
 open Threadext
 open Pervasiveext
+open Listext
 open Stringext
 open Server_helpers
 open Client
@@ -1080,7 +1081,7 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
                            (fun session_id rpc -> Client.VM.start rpc session_id vm start_paused force)))));
       update_vbd_operations ~__context ~vm;      
       update_vif_operations ~__context ~vm;
-      let uuid = Db.VM.get_uuid ~__context ~self:vm in
+      let _ (* uuid *) = Db.VM.get_uuid ~__context ~self:vm in
       let message_body = 
        Printf.sprintf "VM '%s' started on host: %s (uuid: %s)" 
          (Db.VM.get_name_label ~__context ~self:vm)
@@ -1177,8 +1178,7 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
                        else
                          Some (Db.VBD.get_VDI ~__context ~self:vbd))
                     (Db.VM.get_VBDs ~__context ~self:vm) in
-                let all_vm_vdis = List.filter (fun x -> match x with (Some _) -> true | _ -> false) all_vm_vdis in
-                let all_vm_vdis = List.map (fun x -> match x with (Some y)->y) all_vm_vdis in
+                let all_vm_vdis = List.unbox_list all_vm_vdis in
                 let all_vm_srs = List.map (fun vdi -> Db.VDI.get_SR ~self:vdi ~__context) all_vm_vdis in
                 let suitable_host = Xapi_vm_helpers.choose_host ~__context ~vm:vm
                   ~choose_fn:(Xapi_vm_helpers.assert_can_see_specified_SRs ~__context ~reqd_srs:all_vm_srs) () in
index 1e15641b4fb9fc9b937500312803be95f407bbaa..1fe58220c9f030856dc91d399cbd42b3101f0b5a 100644 (file)
@@ -111,11 +111,11 @@ let assert_bacon_mode ~__context ~host =
        let vms = Db.VM.get_refs_where ~__context ~expr:(And(Eq (Field "resident_on", Literal (Ref.string_of host)),
                                                                        Eq (Field "power_state", Literal "Running"))) in
        (* We always expect a control domain to be resident on a host *)
-       match List.filter (fun vm -> not (Db.VM.get_is_control_domain ~__context ~self:vm)) vms with
+       (match List.filter (fun vm -> not (Db.VM.get_is_control_domain ~__context ~self:vm)) vms with
        | [] -> ()
        | guest_vms -> 
                let vm_data = [selfref; "vm"; Ref.string_of (List.hd guest_vms)] in
-               raise (Api_errors.Server_error (Api_errors.host_in_use, vm_data))
+               raise (Api_errors.Server_error (Api_errors.host_in_use, vm_data)));
        debug "Bacon test: VMs OK - %d running VMs" (List.length vms);
        let controldomain = List.find (fun vm -> Db.VM.get_resident_on ~__context ~self:vm = host &&
                        Db.VM.get_is_control_domain ~__context ~self:vm) (Db.VM.get_all ~__context) in  
index d212cdeae5ece55a92f63e311ea4045c41d9f3a6..8e5e188f44c0fff3141bbb58cde0f16813fec237 100644 (file)
@@ -159,8 +159,6 @@ let set_memory_limits ~__context ~self
        if Db.VM.get_power_state ~__context ~self <> `Halted
        then failwith "assertion_failed: set_memory_limits should only be \
                called when the VM is Halted";
-       (* Support the redundant target field. *)
-       let target = dynamic_min in
        (* Check that the new limits are in the correct order. *)
        let constraints = {Vm_memory_constraints.
                static_min  = static_min;
index f71a3799f806bd8863c905ca07624d8edcd84538..bfa4bd5b8a7f2e6ccbddaf7ebb8654a8e659d644 100644 (file)
@@ -42,7 +42,7 @@ let wait_for ~xs ?(timeout=60. *. 20.) (x: 'a t) =
   let result = ref None in
 
   let start_time = Unix.gettimeofday () in
-  let time_taken () = Unix.gettimeofday () -. start_time in
+  (* let time_taken () = Unix.gettimeofday () -. start_time in *)
 
   let callback (path, _) = 
     match x.evaluate ~xs with
index 3a1e29a7db73c486097823f39c9ca94fc9ed5072..53239d311fd1e68dc165a85a22e13912b6eb340d 100644 (file)
@@ -65,7 +65,6 @@ let string_of_dev_state = function
 
 let string_of_dev_event ev =
        let string_of_string_opt = function None -> "\"\"" | Some s -> s in
-       let string_of_b b = if b then "B" else "F" in
        match ev with
        | DevEject i ->
                sprintf "device eject {%s}" i