File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -245,14 +245,16 @@ let assert_vdi_format_is_supported ~__context ~vdi_map ~vdi_format_map =
245245 Db.SM. get_refs_where ~__context
246246 ~expr: (Eq (Field " type" , Literal sr_type))
247247 in
248+ (* We expect that one sr_type matches one sm_ref *)
248249 match sm_refs with
249250 | [sm_ref] ->
250251 debug " GTNDEBUG: read vdi %s, sr %s. Type is %s" vdi_uuid sr_uuid
251252 ty ;
252253 let sm_formats =
253254 Db.SM. get_supported_image_formats ~__context ~self: sm_ref
254255 in
255- if sm_formats <> [] && not (List. mem ty sm_formats) then
256+ if ty <> " " && sm_formats <> [] && not (List. mem ty sm_formats)
257+ then
256258 raise
257259 Api_errors. (
258260 Server_error
@@ -271,7 +273,7 @@ let assert_vdi_format_is_supported ~__context ~vdi_map ~vdi_format_map =
271273 , [
272274 Printf. sprintf
273275 " Found more than one SM ref (%d) when checking type \
274- (%s)of VDI."
276+ (%s) of VDI."
275277 (List. length sm_refs) ty
276278 ]
277279 )
You can’t perform that action at this time.
0 commit comments