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 06 of 11] CA-35165: Mute the error when looking for SM

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 06 of 11] CA-35165: Mute the error when looking for SM backends in directories which don't exist
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 15:40:58 +0000
Delivery-date: Mon, 30 Nov 2009 07:40:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1259595652@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 1259595424 0
# Node ID d92c3fc8e193282a67da4e921f3159165313f31d
# Parent  b7ea5ea562e0a28e01736cbf7b7fc4b20f2f579d
CA-35165: Mute the error when looking for SM backends in directories which 
don't exist.

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

diff -r b7ea5ea562e0 -r d92c3fc8e193 ocaml/xapi/sm_exec.ml
--- a/ocaml/xapi/sm_exec.ml     Mon Nov 30 15:37:03 2009 +0000
+++ b/ocaml/xapi/sm_exec.ml     Mon Nov 30 15:37:04 2009 +0000
@@ -336,11 +336,13 @@
 
   List.iter 
     (fun (f, dir) ->
-      debug "Scanning directory %s for SM backends..." dir;
-      try Array.iter f (Sys.readdir dir)
-      with _ ->
-        log_backtrace ();
-        error "Error checking directory %s for SM backends" dir
+                if Sys.file_exists dir then begin
+                  debug "Scanning directory %s for SM backends" dir;
+                  try Array.iter f (Sys.readdir dir)
+                  with e ->
+                          log_backtrace ();
+                          error "Error checking directory %s for SM backends: 
%s" dir (ExnHelper.string_of_exn e)
+                end else debug "Not scanning %s for SM backends: directory 
does not exist" dir
     ) 
     [ check_driver, sm_dir;
       check_daemon, sm_daemon_dir; ]
1 file changed, 7 insertions(+), 5 deletions(-)
ocaml/xapi/sm_exec.ml |   12 +++++++-----


Attachment: xen-api.hg-11.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>