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 11:04:01 +0000
Delivery-date: Wed, 11 Nov 2009 03:04:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1257937439@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 1257937333 0
# Node ID 85f6426d2f2981516940e18badbb3303e8851afd
# Parent  79497a2093dd6f376b1fc58b8c1fd192ede1470f
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 79497a2093dd -r 85f6426d2f29 ocaml/xenops/squeezed.ml
--- a/ocaml/xenops/squeezed.ml  Wed Nov 11 11:02:01 2009 +0000
+++ b/ocaml/xenops/squeezed.ml  Wed Nov 11 11:02:13 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 79497a2093dd -r 85f6426d2f29 ocaml/xenops/squeezed_client.ml
--- a/ocaml/xenops/squeezed_client.ml   Wed Nov 11 11:02:01 2009 +0000
+++ b/ocaml/xenops/squeezed_client.ml   Wed Nov 11 11:02:13 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 79497a2093dd -r 85f6426d2f29 ocaml/xenops/squeezed_rpc.ml
--- a/ocaml/xenops/squeezed_rpc.ml      Wed Nov 11 11:02:01 2009 +0000
+++ b/ocaml/xenops/squeezed_rpc.ml      Wed Nov 11 11:02:13 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 79497a2093dd -r 85f6426d2f29 ocaml/xenops/xenops.ml
--- a/ocaml/xenops/xenops.ml    Wed Nov 11 11:02:01 2009 +0000
+++ b/ocaml/xenops/xenops.ml    Wed Nov 11 11:02:13 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