File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
examples/volume/org.xen.xcp.storage.plainlvm Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 11# ! / usr/ bin/ env ocamlscript
22Ocaml. sources := [" common.ml" ; " lvm.ml" ];
3- Ocaml. packs := [" xapi-storage" ; " cmdliner" ; " re.str" ; " oUnit" ];
3+ Ocaml. packs := [" xapi-storage" ; " cmdliner" ; " re.str" ; " oUnit" ; " uri " ];
44Ocaml. ocamlflags := [" -thread" ]
55--
66(*
@@ -22,14 +22,12 @@ module Command = struct
2222 open Storage.V.Types
2323 include Volume. Stat
2424
25- let command common { Volume.Stat.In. dbg; sr; key } = {
26- key = key;
27- name = " name" ;
28- description = " description" ;
29- read_write = true ;
30- uri = [ " nfs+vhd://" ^ key ];
31- virtual_size = 1L ;
32- }
25+ let command common { Volume.Stat.In. dbg; sr; key } =
26+ let all = Lvm. lvs sr in
27+ try
28+ Lvm. volume_of_lv sr (List. find (fun x -> x.Lvm. name = key) all)
29+ with Not_found ->
30+ raise (Storage.V. Volume_does_not_exist key)
3331end
3432
3533module Test = struct
You can’t perform that action at this time.
0 commit comments