You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CP-24914: Vdi.get_nbd_info: return type with cert (xapi-project#3257)
* CP-24914: Vdi.get_nbd_info: return type with cert
Instead of a list of strings, this function now returns a list
of a record-type which is newly defined in the datamodel.
This breaks and disables one of the unit-test-cases that
test the function.
Signed-off-by: Thomas Sanders <[email protected]>
Copy file name to clipboardExpand all lines: ocaml/idl/datamodel.ml
+33-4Lines changed: 33 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ let _pvs_proxy = "PVS_proxy"
170
170
let _pvs_cache_storage ="PVS_cache_storage"
171
171
let _feature ="Feature"
172
172
let _sdn_controller ="SDN_controller"
173
-
173
+
let _vdi_nbd_server_info ="vdi_nbd_server_info"
174
174
175
175
(** All the various static role names *)
176
176
@@ -6683,17 +6683,44 @@ let vdi_list_changed_blocks = call
6683
6683
~allowed_roles:_R_VM_OP
6684
6684
()
6685
6685
6686
+
moduleVdi_nbd_server_info=struct
6687
+
let vdi_nbd_server_info =
6688
+
let lifecycle = [Published, rel_inverness, ""] in
6689
+
create_obj
6690
+
~in_db:false
6691
+
~persist:PersistNothing
6692
+
~gen_constructor_destructor:false
6693
+
~lifecycle
6694
+
~in_oss_since:None
6695
+
~name:_vdi_nbd_server_info
6696
+
~descr:"Details for connecting to a VDI using the Network Block Device protocol"
6697
+
~gen_events:false
6698
+
~messages:[]
6699
+
~doccomments:[]
6700
+
~messages_default_allowed_roles:(Some[]) (* No messages, so no roles allowed to use them *)
6701
+
~contents:
6702
+
[ (* uid _vdi_nbd_server_info; The uuid is not needed here and only adds inconvenience. *)
6703
+
field ~qualifier:DynamicRO~lifecycle~ty:String"exportname""The exportname to request over NBD. This holds details including an authentication token, so it must be protected appropriately. Clients should regard the exportname as an opaque string or token.";
6704
+
field ~qualifier:DynamicRO~lifecycle~ty:String"address""An address on which the server can be reached; this can be IPv4, IPv6, or a DNS name.";
6705
+
field ~qualifier:DynamicRO~lifecycle~ty:Int"port""The TCP port";
6706
+
field ~qualifier:DynamicRO~lifecycle~ty:String"cert""The TLS certificate of the server";
6707
+
field ~qualifier:DynamicRO~lifecycle~ty:String"subject""For convenience, this redundant field holds a subject of the certificate.";
6708
+
] ()
6709
+
end
6710
+
let vdi_nbd_server_info =Vdi_nbd_server_info.vdi_nbd_server_info
6711
+
6686
6712
let vdi_get_nbd_info = call
6687
6713
~name:"get_nbd_info"
6688
6714
~in_oss_since:None
6689
6715
~in_product_since:rel_inverness
6690
-
~params:[Ref _vdi, "self", "The VDI to access via NBD."]
6716
+
~params:[Ref _vdi, "self", "The VDI to access via Network Block Device protocol"]
6691
6717
~errs: [Api_errors.vdi_incompatible_type]
6692
-
~result:(SetString, "The list of URIs.")
6693
-
~doc:"Get a list of URIs specifying how to access this VDI via the NBD serverof XenServer. A URI will be returned for each PIF of each host that is connected to the VDI's SR. An empty list is returned in case no network has a PIF on a host with access to the relevant SR. To access the given VDI, any of the returned URIs can be passed as the export name to the nbd-server running at the IP address and port specified by that URI."
6718
+
~result:(Set(Record _vdi_nbd_server_info), "The details necessary for connecting to the VDI over NBD. This includes an authentication token, so must be treated as sensitive material and must not be sent over insecure networks.")
6719
+
~doc:"Get details specifying how to access this VDI via a Network Block Device server. For each of a set of NBD server addresses on which the VDI is available, the return value set contains a vdi_nbd_server_info object that contains an exportname to request once the NBD connection is established, and connection details for the address. An empty list is returned if there is no network that has a PIF on a host with access to the relevant SR, or if no such network has been assigned an NBD-related purpose in its purpose field. To access the given VDI, any of the vdi_nbd_server_info objects can be used to make a connection to a server, and then the VDI will be available by requesting the exportname."
6694
6720
~allowed_roles:_R_VM_ADMIN
6695
6721
()
6696
6722
6723
+
6697
6724
(** A virtual disk *)
6698
6725
let vdi =
6699
6726
create_obj ~in_db:true~in_product_since:rel_rio ~in_oss_since:oss_since_303 ~internal_deprecated_since:None~persist:PersistEverything~gen_constructor_destructor:true~name:_vdi ~descr:"A virtual disk image"
@@ -9960,6 +9987,7 @@ let all_system =
9960
9987
pvs_cache_storage;
9961
9988
feature;
9962
9989
sdn_controller;
9990
+
vdi_nbd_server_info;
9963
9991
]
9964
9992
9965
9993
(** These are the pairs of (object, field) which are bound together in the database schema *)
@@ -10138,6 +10166,7 @@ let expose_get_all_messages_for = [
10138
10166
_pvs_cache_storage;
10139
10167
_feature;
10140
10168
_sdn_controller;
10169
+
(* _vdi_nbd_server_info must NOT be included here *)
10141
10170
]
10142
10171
10143
10172
let no_task_id_for = [ _task; (* _alert; *) _event ]
0 commit comments