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

CA-388210: enable SMAPIv3 concurrent operations by default #6141

Merged
merged 4 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
CA-388210: SMAPIv3 concurrency safety: send the (unique) datapath arg…
…ument as domain for Dom0

Dom0 allows multiple attaches of RO disks, used e.g. for VDI.copy.
Send a unique value to SMAPIv3 plugins to avoid bugs to the lack of reference counting in those plugins.

XAPI already sends a unique value here, either vbd/domid/device, or a fresh UUID (for storage migration).

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
  • Loading branch information
edwintorok committed Nov 29, 2024
commit 864d73420e654b5395a6e98a60615ed292a6e1dd
17 changes: 16 additions & 1 deletion ocaml/xapi-storage-script/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,22 @@ let backend_backtrace_error name args backtrace =
let missing_uri () =
backend_error "MISSING_URI" ["Please include a URI in the device-config"]

let domain_of ~dp:_ ~vm' = Storage_interface.Vm.string_of vm'
(** return a unique 'domain' string for Dom0, so that we can plug disks
multiple times (e.g. for copy).

XAPI should give us a unique 'dp' (datapath) string, e.g. a UUID for storage migration,
or vbd/domid/device.
For regular guests keep the domain as passed by XAPI (an integer).
*)
let domain_of ~dp ~vm' =
let vm = Storage_interface.Vm.string_of vm' in
match vm with
| "0" ->
(* SM tries to use this in filesystem paths, so cannot have /,
and systemd might be a bit unhappy with - *)
"u0-" ^ dp |> String.map ~f:(function '/' | '-' -> '_' | c -> c)
| _ ->
vm

(** Functions to wrap calls to the above client modules and convert their
exceptions and errors into SMAPIv2 errors of type
Expand Down