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] extra option for quicktest

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] extra option for quicktest
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Wed, 24 Mar 2010 18:40:47 +0000
Delivery-date: Wed, 24 Mar 2010 11:31:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 1269455993 0
# Node ID 4abf9f20e0120254ad922ad9c0bcd6ad5d690d1b
# Parent  68cdacd74d3f293885e1714687489db35b8900bc
CA-39371: quicktest will avoid calling VDI.create and VDI.destroy on an SR if 
the special other-config:quicktest-no-VDI_CREATE key is set.

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

diff -r 68cdacd74d3f -r 4abf9f20e012 ocaml/xapi/quicktest_storage.ml
--- a/ocaml/xapi/quicktest_storage.ml   Wed Mar 24 11:10:58 2010 +0000
+++ b/ocaml/xapi/quicktest_storage.ml   Wed Mar 24 18:39:53 2010 +0000
@@ -524,9 +524,15 @@
   | [ _, plugin ] ->
       plugin.API.sM_capabilities 
 
-let is_tools_sr session_id sr = 
+(* Even though the SM backend may expose a VDI_CREATE capability attempts
+   to actually create a VDI will fail in (eg) the tools SR and any that
+   happen to be R/O NFS exports *)
+let avoid_vdi_create session_id sr = 
   let other_config = Client.SR.get_other_config !rpc session_id sr in
-  List.mem_assoc Xapi_globs.tools_sr_tag other_config 
+  let is_tools_sr = List.mem_assoc Xapi_globs.tools_sr_tag other_config in
+  let special_key = "quicktest-no-VDI_CREATE" in
+  let is_marked = List.mem_assoc special_key other_config && List.assoc 
special_key other_config = "true" in
+  is_tools_sr || is_marked
 
 let foreach_sr session_id sr = 
   let ty = Client.SR.get_type !rpc session_id sr in
@@ -544,7 +550,7 @@
          create and delete capabilities are forbidden in that special case.
          See Xapi_sr.valid_operations. *)
       let caps =
-        if is_tools_sr session_id sr then
+        if avoid_vdi_create session_id sr then
           List.filter
             (fun cap -> not (List.mem cap [ vdi_create; vdi_delete ])) caps
         else
1 file changed, 9 insertions(+), 3 deletions(-)
ocaml/xapi/quicktest_storage.ml |   12 +++++++++---


Attachment: xen-api.hg.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>
  • [Xen-API] [PATCH] extra option for quicktest, David Scott <=