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 3 of 9] CA-31528: Remove the Xal DevClosed event since

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 3 of 9] CA-31528: Remove the Xal DevClosed event since it is unused
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 15:45:50 +0000
Delivery-date: Mon, 30 Nov 2009 07:43:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1259595947@xxxxxxxxxxxxxxxxxxxx>
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 David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259595835 0
# Node ID be58692e3374e2a2de389fe2c6c80ec734224ed8
# Parent  c793d4a3f647b335cb665a1d15f2f2ef01241166
CA-31528: Remove the Xal DevClosed event since it is unused.

This also allows us to delete the diff_device_state function.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r c793d4a3f647 -r be58692e3374 ocaml/xenops/xal.ml
--- a/ocaml/xenops/xal.ml       Mon Nov 30 15:43:54 2009 +0000
+++ b/ocaml/xenops/xal.ml       Mon Nov 30 15:43:55 2009 +0000
@@ -28,7 +28,6 @@
 
 type dev_event =
        (* devices : backend / type / devid *)
-       | DevClosed of bool * string * string
        | DevError of string * string * string
        | DevEject of string * string
        (* device thread start : type / devid / pid *)
@@ -71,8 +70,6 @@
        let string_of_string_opt = function None -> "\"\"" | Some s -> s in
        let string_of_b b = if b then "B" else "F" in
        match ev with
-       | DevClosed (b, s, i) ->
-               sprintf "device closed {%s,%s,%s}" (string_of_b b) s i
        | DevError (s, i, e) ->
                sprintf "device error {%s,%s} \"%s\"" s i e
        | DevEject (s, i) ->
@@ -568,22 +565,6 @@
        (try Xc.interface_close ctx.xc 
         with e -> error "Caught exception: %s while closing xc" 
(Printexc.to_string e))
 
-let diff_device_state backend ty devid oldstate newstate =
-       let closed () = DevClosed (backend, ty, devid) in
-       if oldstate <> newstate then
-               match oldstate, newstate with
-               | Connecting, Closed     -> [ closed () ]
-               | Connected,  Closing    -> [ closed () ]
-               | Connected,  Closed     -> [ closed () ]
-               | Closing,    Closed     -> [ closed () ]
-               (* those should not happen *)
-               | Closing,    Connecting -> []
-               | Closing,    Connected  -> []
-               | Connected,  Connecting -> []
-               | _                      -> []
-       else
-               []
-
 let domain_device_event ctx w v =
        match other_watch ctx.xs w v with
        | None                        -> ()
@@ -605,15 +586,9 @@
                | Backend state  ->
                        let oldstate = devstate.backstate in
                        devstate.backstate <- state;
-                       let evs = diff_device_state true ty devid oldstate 
state in
-                       List.iter (fun ev -> ctx.callback_devices ctx domid ev)
-                                 evs
                | Frontend state ->
                        let oldstate = devstate.frontstate in
                        devstate.frontstate <- state;
-                       let evs = diff_device_state false ty devid oldstate 
state in
-                       List.iter (fun ev -> ctx.callback_devices ctx domid ev)
-                                 evs
                | Error error ->
                        devstate.error <- (Some error);
                        ctx.callback_devices ctx domid (DevError (ty, devid, 
error))
diff -r c793d4a3f647 -r be58692e3374 ocaml/xenops/xal.mli
--- a/ocaml/xenops/xal.mli      Mon Nov 30 15:43:54 2009 +0000
+++ b/ocaml/xenops/xal.mli      Mon Nov 30 15:43:55 2009 +0000
@@ -37,7 +37,6 @@
 exception Timeout
 
 type dev_event =
-       | DevClosed of bool * string * string
        | DevError of string * string * string
        | DevEject of string * string
        | DevThread of string * string * int
2 files changed, 26 deletions(-)
ocaml/xenops/xal.ml  |   25 -------------------------
ocaml/xenops/xal.mli |    1 -


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

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