|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH 2 of 3] Removes duplicate definitions of functions (wit
# HG changeset patch
# User Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
# Date 1257936530 0
# Node ID a2c36f7b822eaafaa711a6da3a116d5ad34b88e4
# Parent 94ea8c36bab4e6255630e99491f0d0202aea0a88
Removes duplicate definitions of functions
(with_{xal,xc,xs,xc_and_xs,xs_and_xs_final}) from the Xenops layer.
Signed-off-by: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
diff -r 94ea8c36bab4 -r a2c36f7b822e ocaml/xenops/squeezed.ml
--- a/ocaml/xenops/squeezed.ml Wed Nov 11 10:48:34 2009 +0000
+++ b/ocaml/xenops/squeezed.ml Wed Nov 11 10:48:50 2009 +0000
@@ -14,10 +14,10 @@
let default_pidfile = "/var/run/squeezed.pid"
let log_file_path = "file:/var/log/squeezed.log"
-
open Pervasiveext
open Squeezed_rpc
open Squeezed_state
+open Xenops_helpers
(* We assume only one instance of a named service logs in at a time and
therefore can use
the service name as a session_id. *)
diff -r 94ea8c36bab4 -r a2c36f7b822e ocaml/xenops/squeezed_client.ml
--- a/ocaml/xenops/squeezed_client.ml Wed Nov 11 10:48:34 2009 +0000
+++ b/ocaml/xenops/squeezed_client.ml Wed Nov 11 10:48:50 2009 +0000
@@ -12,6 +12,7 @@
* GNU Lesser General Public License for more details.
*)
open Squeezed_rpc
+open Xenops_helpers
let _ =
print_debug := true;
diff -r 94ea8c36bab4 -r a2c36f7b822e ocaml/xenops/squeezed_rpc.ml
--- a/ocaml/xenops/squeezed_rpc.ml Wed Nov 11 10:48:34 2009 +0000
+++ b/ocaml/xenops/squeezed_rpc.ml Wed Nov 11 10:48:50 2009 +0000
@@ -15,6 +15,7 @@
(** Potentially generic xenstore RPC stuff *)
open Pervasiveext
+open Xenops_helpers
(* Service-specific: *)
let _service = "squeezed" (* prefix in xenstore of daemon *)
@@ -79,13 +80,6 @@
Printf.printf "%s %s\n" (time_of_float (Unix.gettimeofday ())) s;
flush stdout) fmt
else Printf.kprintf (fun s -> debug "%s" s) fmt
-
-
-let with_xc_and_xs f =
- Xc.with_intf
- (fun xc ->
- let xs = Xs.daemon_open () in
- finally (fun () -> f xc xs) (fun () -> Xs.close xs))
let path = List.fold_left Filename.concat "/"
diff -r 94ea8c36bab4 -r a2c36f7b822e ocaml/xenops/xenops.ml
--- a/ocaml/xenops/xenops.ml Wed Nov 11 10:48:34 2009 +0000
+++ b/ocaml/xenops/xenops.ml Wed Nov 11 10:48:50 2009 +0000
@@ -15,16 +15,7 @@
open Pervasiveext
open Stringext
open Device_common
-
-let with_xal f =
- let xal = Xal.init () in
- finally (fun () -> f xal) (fun () -> Xal.close xal)
-
-let with_xc f = Xc.with_intf f
-let with_xs f =
- let xs = Xs.daemon_open () in
- finally (fun () -> f xs) (fun () -> Xs.close xs)
-let with_xc_and_xs f = with_xc (fun xc -> with_xs (fun xs -> f xc xs))
+open Xenops_helpers
let print_xen_dmesg ~xc =
let s = Xc.readconsolering xc in
4 files changed, 4 insertions(+), 18 deletions(-)
ocaml/xenops/squeezed.ml | 2 +-
ocaml/xenops/squeezed_client.ml | 1 +
ocaml/xenops/squeezed_rpc.ml | 8 +-------
ocaml/xenops/xenops.ml | 11 +----------
xen-api.hg-3.patch
Description: Text Data
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-API] [PATCH 0 of 3] Adds a command-line utility 'memory-breakdown' which displays a detailed breakdown of host and guest memory usage., Jonathan Knowles
- [Xen-API] [PATCH 1 of 3] Moves low-level functions with_{xal, xc, xs, xc_and_xs, xs_and_xs_final} from the Xapi layer into the Xenops layer, allowing greater reuse, Jonathan Knowles
- [Xen-API] [PATCH 2 of 3] Removes duplicate definitions of functions (with_{xal, xc, xs, xc_and_xs, xs_and_xs_final}) from the Xenops layer,
Jonathan Knowles <=
- [Xen-API] [PATCH 3 of 3] Adds a command-line utility "memory-breakdown" which displays a detailed breakdown of host and guest memory usage, Jonathan Knowles
|
|
|
|
|