Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[477 idl part2] SR.create API change and sharable flag #202

Merged
merged 4 commits into from
Feb 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions storage/storage_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,4 @@ module Client = Storage_interface.Client(struct
)
end)

let default_vdi_info = {
vdi = "";
uuid = None;
content_id = "";
name_label = "";
name_description = "";
ty = "user";
metadata_of_pool = "";
is_a_snapshot = false;
snapshot_time = "19700101T00:00:00Z";
snapshot_of = "";
read_only = false;
cbt_enabled = false;
virtual_size = 0L;
physical_utilisation = 0L;
persistent = true;
sm_config = [];
}
let default_vdi_info = Storage_interface.default_vdi_info
7 changes: 6 additions & 1 deletion storage/storage_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type vdi_info = {
physical_utilisation: int64;
(* xenstore_data: workaround via XenAPI *)
persistent: bool;
sharable: bool;
sm_config: (string * string) list;
}

Expand All @@ -88,6 +89,7 @@ let default_vdi_info = {
virtual_size = 0L;
physical_utilisation = 0L;
persistent = true;
sharable = false;
sm_config = [];
}

Expand Down Expand Up @@ -201,6 +203,8 @@ module Dynamic = struct

end

type uuid = string

exception Backend_error_with_backtrace of (string * (string list)) (** name * params *)

exception Sr_not_attached of string (** error: SR must be attached to access VDIs *)
Expand All @@ -212,6 +216,7 @@ exception Cancelled of string
exception Redirect of string option
exception Sr_attached of string
exception Unimplemented of string
exception Activated_on_another_host of uuid
exception Duplicated_key of string
exception No_storage_plugin_for_sr of string
exception Content_ids_do_not_match of (string * string)
Expand Down Expand Up @@ -266,7 +271,7 @@ module SR = struct
(** Functions which manipulate SRs *)

(** [create dbg sr name_label name_description device_config physical_size] creates an sr with id [sr] *)
external create : dbg:debug_info -> sr:sr -> name_label:string -> name_description:string -> device_config:(string * string) list -> physical_size:int64 -> unit = ""
external create : dbg:debug_info -> sr:sr -> name_label:string -> name_description:string -> device_config:(string * string) list -> physical_size:int64 -> (string * string) list = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it returns the UUID as a string * string list? 😮

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns an updated device-config, containing the UUID. I think it is the equivalent of { foo with uuid = ...}, except device-config is a string map not a regular type.


(** [set_name_label sr new_name_label] updates the name_label of SR [sr]. *)
external set_name_label : dbg:debug_info -> sr:sr -> new_name_label:string -> unit = ""
Expand Down