WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 2 of 3] Removes duplicate definitions of functions (wit

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [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
From: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Wed, 11 Nov 2009 10:58:50 +0000
Delivery-date: Wed, 11 Nov 2009 02:59:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1257937128@radon>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# 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 +----------


Attachment: xen-api.hg-3.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api