Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ocaml/xapi/export_raw_vdi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let localhost_handler rpc session_id vdi (req : Http.Request.t)
debug "Copying VDI contents..." ;
match format with
| Qcow ->
Qcow_tool_wrapper.send
Qcow_tool_wrapper.send ?relative_to:base_path
(Qcow_tool_wrapper.update_task_progress __context)
s path size
| Vhd | Tar | Raw ->
Expand Down
8 changes: 5 additions & 3 deletions ocaml/xapi/qcow_tool_wrapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ let receive (progress_cb : int -> unit) (unix_fd : Unix.file_descr)
debug "Calling Qcow_stream.stream_decode (output_path = '%s')" path ;
Qcow_stream.stream_decode ~progress_cb unix_fd path

let send (progress_cb : int -> unit) (unix_fd : Unix.file_descr) (path : string)
(_size : Int64.t) =
let args = [path] in
let send ?relative_to (progress_cb : int -> unit) (unix_fd : Unix.file_descr)
(path : string) (_size : Int64.t) =
let args =
[path] @ match relative_to with None -> [] | Some vdi -> ["--diff"; vdi]
in
run_qcow_tool progress_cb args unix_fd
25 changes: 25 additions & 0 deletions ocaml/xapi/qcow_tool_wrapper.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(*
* Copyright (C) 2025 Vates.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val update_task_progress : Context.t -> int -> unit

val receive : (int -> unit) -> Unix.file_descr -> string -> unit

val send :
?relative_to:string
-> (int -> unit)
-> Unix.file_descr
-> string
-> int64
-> unit
Loading