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 1 of 3] Moves low-level functions with_{xal, xc, xs, x

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [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
From: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Date: Wed, 11 Nov 2009 10:58:49 +0000
Delivery-date: Wed, 11 Nov 2009 02:59:18 -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 1257936514 0
# Node ID 94ea8c36bab4e6255630e99491f0d0202aea0a88
# Parent  27928d01b164e09574d8ae9f9e173c0f76c4803c
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.
Signed-off-by: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>

diff -r 27928d01b164 -r 94ea8c36bab4 ocaml/xapi/vmopshelpers.ml
--- a/ocaml/xapi/vmopshelpers.ml        Fri Nov 06 10:59:32 2009 +0000
+++ b/ocaml/xapi/vmopshelpers.ml        Wed Nov 11 10:48:34 2009 +0000
@@ -16,22 +16,15 @@
 module D = Debug.Debugger(struct let name="xapi" end)
 open D
 
-(* xc and xs opening/cleaning interface helpers *)
-let with_xc f = Xc.with_intf f
+(** {2 XC, XS and XAL interface helpers.} *)
 
-let with_xs f =
-       let xs = Xs.daemon_open () in
-       finally (fun () -> f xs) (fun () -> Xs.close xs)
+open Xenops_helpers
 
-let with_xal f =
-       let xal = Xal.init () in
-       finally (fun () -> f xal) (fun () -> Xal.close xal)
-
-let with_xc_and_xs f =
-       Xc.with_intf (fun xc -> with_xs (fun xs -> f xc xs))
-
-let with_xc_and_xs_final f cf =
-       with_xc_and_xs (fun xc xs -> finally (fun () -> f xc xs) cf)
+let with_xc              = with_xc
+let with_xs              = with_xs
+let with_xal             = with_xal
+let with_xc_and_xs       = with_xc_and_xs
+let with_xc_and_xs_final = with_xc_and_xs_final
 
 exception Vm_corresponding_to_domid_not_in_db of int
 let uuid_of_domid domid =
diff -r 27928d01b164 -r 94ea8c36bab4 ocaml/xenops/OMakefile
--- a/ocaml/xenops/OMakefile    Fri Nov 06 10:59:32 2009 +0000
+++ b/ocaml/xenops/OMakefile    Wed Nov 11 10:48:34 2009 +0000
@@ -7,7 +7,7 @@
 OCAMLPACKS     = threads xc xs stdext log
 OCAMLFLAGS    += -thread
 
-LIBFILES = xenbus balloon xenguestHelper domain hotplug device io statdev xal 
netman memory watch device_common squeeze squeeze_xen squeezed_rpc 
squeezed_state squeezed_rpc
+LIBFILES = xenops_helpers xenbus balloon xenguestHelper domain hotplug device 
io statdev xal netman memory watch device_common squeeze squeeze_xen 
squeezed_rpc squeezed_state squeezed_rpc
 
 StaticCLibrary(statdev_stubs, statdev_stubs)
 OCamlLibraryClib(xenops, $(LIBFILES), statdev_stubs)
2 files changed, 8 insertions(+), 15 deletions(-)
ocaml/xapi/vmopshelpers.ml |   21 +++++++--------------
ocaml/xenops/OMakefile     |    2 +-


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

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