# 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 \
+++ /dev/null
-(*
- * 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)
--- /dev/null
+(*
+ * 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)