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] Pass name_label to SM backends on VDI create

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] Pass name_label to SM backends on VDI create
From: Jon Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>
Date: Fri, 15 Oct 2010 13:23:41 +0100
Delivery-date: Fri, 15 Oct 2010 05:23:46 -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
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User Jonathan Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>
# Date 1287145402 -3600
# Node ID 28031e4be8ce2fcdeea28f347b53baed8d1fc946
# Parent  7438d990fed8255bba2d592f767de133bd45863a
Pass the name of the VDI to the SM backends on VDI.create.

Signed-off-by: Jon Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>

diff -r 7438d990fed8 -r 28031e4be8ce ocaml/xapi/sm.ml
--- a/ocaml/xapi/sm.ml
+++ b/ocaml/xapi/sm.ml
@@ -126,9 +126,9 @@
   let call = Sm_exec.make_call ~sr_ref:sr dconf "sr_update" [] in
   Sm_exec.parse_unit (Sm_exec.exec_xmlrpc (driver_type driver)  
(driver_filename driver) call)
 
-let vdi_create dconf driver sr sm_config size =
+let vdi_create dconf driver sr sm_config size name_label =
   debug "vdi_create" driver (sprintf "sr=%s sm_config=[%s] size=%Ld" 
(Ref.string_of sr) (String.concat "; " (List.map (fun (k, v) -> k ^ "=" ^ v) 
sm_config)) size);
-  let call = Sm_exec.make_call ~sr_ref:sr ~vdi_sm_config:sm_config dconf 
"vdi_create" [ sprintf "%Lu" size ] in
+  let call = Sm_exec.make_call ~sr_ref:sr ~vdi_sm_config:sm_config dconf 
"vdi_create" [ sprintf "%Lu" size; name_label ] in
   Sm_exec.parse_vdi_info (Sm_exec.exec_xmlrpc (driver_type driver)  
(driver_filename driver) call)
 
 let vdi_update dconf driver sr vdi = 
diff -r 7438d990fed8 -r 28031e4be8ce ocaml/xapi/xapi_vdi.ml
--- a/ocaml/xapi/xapi_vdi.ml
+++ b/ocaml/xapi/xapi_vdi.ml
@@ -198,7 +198,7 @@
        let vdi_info = 
            Sm.call_sm_functions ~__context ~sR
              (fun device_config sr_type ->
-               Sm.vdi_create device_config sr_type sR sm_config virtual_size)
+               Sm.vdi_create device_config sr_type sR sm_config virtual_size 
name_label)
        in
        let uuid = require_uuid vdi_info in
        let ref = Db.VDI.get_by_uuid ~__context ~uuid in
 ocaml/xapi/sm.ml       |  4 ++--
 ocaml/xapi/xapi_vdi.ml |  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)


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] Pass name_label to SM backends on VDI create, Jon Ludlam <=