]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
change name of xenvm-cmd.ml to workaround an ocaml compiler warning about invalid...
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Tue, 18 Aug 2009 17:26:38 +0000 (18:26 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Tue, 18 Aug 2009 17:26:38 +0000 (18:26 +0100)
xenvm/Makefile
xenvm/xenvm-cmd.ml [deleted file]
xenvm/xenvm_cmd.ml [new file with mode: 0644]

index 769557ca04777fa879685e7c5b3e1d3da55da674..ab637694d1973e1399929cef5cb4ef986a5bb76c 100644 (file)
@@ -17,10 +17,10 @@ OCAMLOPTFLAGS += -thread
 #      domain
 
 xenvm_OBJS = $(TOPLEVEL)/common/config xenvmlib tasks misc vmconfig vmstate vmact xenvm
-xenvm-cmd_OBJS = xenvmlib xenvm-cmd
+xenvm-cmd_OBJS = xenvmlib xenvm_cmd
 xenops_OBJS = xenops
 
-ALL_OCAML_OBJS = $(TOPLEVEL)/common/config xenvmlib xenvm xenvm-cmd misc tasks vmconfig vmstate vmact xenops
+ALL_OCAML_OBJS = $(TOPLEVEL)/common/config xenvmlib xenvm xenvm_cmd misc tasks vmconfig vmstate vmact xenops
 
 #INTF = watch.cmi netman.cmi balloon.cmi device_common.cmi device.cmi domain.cmi xal.cmi
 xenvm_LIBS = unix.cmxa dBus.cmxa threads.cmxa \
diff --git a/xenvm/xenvm-cmd.ml b/xenvm/xenvm-cmd.ml
deleted file mode 100644 (file)
index e097e10..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-(*
- * Copyright (C) 2006-2007 XenSource Ltd.
- * Copyright (C) 2008      Citrix Ltd.
- * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *)
-
-open Printf
-
-let kvpair s =
-       match Stringext.String.split ~limit:2 '=' s with
-       | k :: v :: [] -> Some (k, v)
-       | _            -> None
-
-let valid_kvpairs args =
-       List.rev (List.fold_left (fun acc x -> match kvpair x with Some x -> x :: acc | None -> acc) [] args)
-
-let _ =
-       let using_socket = ref false in
-       let usage_msg = sprintf "usage: %s [--use-socket] <uuid> <cmd> [cmd args]\n" Sys.argv.(0) in
-       let args = ref [] in
-       Arg.parse [
-               ("--use-socket", Arg.Set using_socket, "use socket instead of dbus");
-       ] (fun s -> args := s :: !args) usage_msg;
-       let args = List.rev !args in
-
-       let using_socket = !using_socket in
-       let uuid, query =
-               match args with
-               | uuid :: cmd :: args -> uuid, (cmd, valid_kvpairs args)
-               | uuid :: []          -> eprintf "error: missing query\n%s" usage_msg; exit 1
-               | []                  -> eprintf "error: missing uuid\n%s" usage_msg; exit 1
-               in
-
-       try
-               match Xenvmlib.request ~using_socket ~timeout:60.0 uuid query with
-               | Xenvmlib.Ok          -> ()
-               | Xenvmlib.Timeout     -> eprintf "timeout\n"; exit 1
-               | Xenvmlib.Error error -> eprintf "error: %s\n" error; exit 1
-               | Xenvmlib.Msg msg     -> printf "%s\n" msg
-               | Xenvmlib.Unknown s   -> eprintf "warning: unknown answer: \"%s\"\n" s
-       with
-       | Xenvmlib.Write_timeout -> eprintf "cannot send command to xenvm. it is dead ?\n"; exit 1
-       | exn                    -> eprintf "receive exception: %s\n" (Printexc.to_string exn)
diff --git a/xenvm/xenvm_cmd.ml b/xenvm/xenvm_cmd.ml
new file mode 100644 (file)
index 0000000..e097e10
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+ * Copyright (C) 2006-2007 XenSource Ltd.
+ * Copyright (C) 2008      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+open Printf
+
+let kvpair s =
+       match Stringext.String.split ~limit:2 '=' s with
+       | k :: v :: [] -> Some (k, v)
+       | _            -> None
+
+let valid_kvpairs args =
+       List.rev (List.fold_left (fun acc x -> match kvpair x with Some x -> x :: acc | None -> acc) [] args)
+
+let _ =
+       let using_socket = ref false in
+       let usage_msg = sprintf "usage: %s [--use-socket] <uuid> <cmd> [cmd args]\n" Sys.argv.(0) in
+       let args = ref [] in
+       Arg.parse [
+               ("--use-socket", Arg.Set using_socket, "use socket instead of dbus");
+       ] (fun s -> args := s :: !args) usage_msg;
+       let args = List.rev !args in
+
+       let using_socket = !using_socket in
+       let uuid, query =
+               match args with
+               | uuid :: cmd :: args -> uuid, (cmd, valid_kvpairs args)
+               | uuid :: []          -> eprintf "error: missing query\n%s" usage_msg; exit 1
+               | []                  -> eprintf "error: missing uuid\n%s" usage_msg; exit 1
+               in
+
+       try
+               match Xenvmlib.request ~using_socket ~timeout:60.0 uuid query with
+               | Xenvmlib.Ok          -> ()
+               | Xenvmlib.Timeout     -> eprintf "timeout\n"; exit 1
+               | Xenvmlib.Error error -> eprintf "error: %s\n" error; exit 1
+               | Xenvmlib.Msg msg     -> printf "%s\n" msg
+               | Xenvmlib.Unknown s   -> eprintf "warning: unknown answer: \"%s\"\n" s
+       with
+       | Xenvmlib.Write_timeout -> eprintf "cannot send command to xenvm. it is dead ?\n"; exit 1
+       | exn                    -> eprintf "receive exception: %s\n" (Printexc.to_string exn)