From 4a1fc3ef1671c9b8c3cf63cbb98d01f260799416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Mon, 26 Feb 2018 16:23:42 +0000 Subject: [PATCH 1/2] CP-26340: SR.probe changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SMAPIv3 returns a list of configurations: * suitable for SR.attach together with sr_info * suitable for SR.create * suitable as further input to SR.probe (recursively) SMAPIv1 is unaffected, it always returns a `Raw` result. Signed-off-by: Edwin Török --- storage/storage_interface.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/storage_interface.ml b/storage/storage_interface.ml index 213974cf..4382bf58 100644 --- a/storage/storage_interface.ml +++ b/storage/storage_interface.ml @@ -118,9 +118,11 @@ type dp_stat_t = { let string_of_dp_stat_t (x: dp_stat_t) = Jsonrpc.to_string (rpc_of_dp_stat_t x) +type device_config = (string * string) list type probe = { - srs: (string * sr_info) list; (* SRs we found *) - uris: string list; (* other uris we found which could be probed recursively *) + attachable: (device_config * sr_info) list; (* Attachable SRs we found *) + creatable: device_config list; (* Complete configurations that can be used to create an SR. *) + incomplete: device_config list; (* other configurations we found which could be probed recursively *) } type probe_result = From 91180d7e36522dbac3b2e90d9ab908d8ca06b8c4 Mon Sep 17 00:00:00 2001 From: Gabor Igloi Date: Thu, 1 Mar 2018 16:41:50 +0000 Subject: [PATCH 2/2] Make probe return value match the one in SMAPIv3 Signed-off-by: Gabor Igloi --- storage/storage_interface.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/storage_interface.ml b/storage/storage_interface.ml index 4382bf58..e0f8802a 100644 --- a/storage/storage_interface.ml +++ b/storage/storage_interface.ml @@ -120,14 +120,15 @@ let string_of_dp_stat_t (x: dp_stat_t) = Jsonrpc.to_string (rpc_of_dp_stat_t x) type device_config = (string * string) list type probe = { - attachable: (device_config * sr_info) list; (* Attachable SRs we found *) - creatable: device_config list; (* Complete configurations that can be used to create an SR. *) - incomplete: device_config list; (* other configurations we found which could be probed recursively *) + configuration: (string * string) list; + complete: bool; + sr: sr_info option; + extra_info: (string * string) list; } type probe_result = | Raw of string (* SMAPIv1 adapters return arbitrary data *) - | Probe of probe + | Probe of probe list module Mirror = struct type id = string