Skip to content

Commit 0c6805f

Browse files
committed
xapi/export: set a date when generating tarballs
Tooling complains about using 1970 as the date otherwise Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 85d5c86 commit 0c6805f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ocaml/xapi/export.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ let export_metadata ~__context ~with_snapshot_metadata ~preserve_power_state
616616
(string_of_bool preserve_power_state)
617617
(String.concat ", " (List.map Devicetype.to_string excluded_devices))
618618
in
619+
let now = Date.now () |> Date.to_unix_time |> Int64.of_float in
619620
( match vms with
620621
| [] ->
621622
failwith "need to specify at least one VM"
@@ -629,14 +630,15 @@ let export_metadata ~__context ~with_snapshot_metadata ~preserve_power_state
629630
~include_vhd_parents ~__context ~vms ~excluded_devices
630631
in
631632
let hdr =
632-
Tar.Header.make Xapi_globs.ova_xml_filename
633+
Tar.Header.make ~mod_time:now Xapi_globs.ova_xml_filename
633634
(Int64.of_int @@ String.length ova_xml)
634635
in
635636
Tar_helpers.write_block hdr (fun s -> Unixext.really_write_string s ova_xml) s ;
636637
Tar_helpers.write_end s
637638

638639
let export refresh_session __context rpc session_id s vm_ref
639640
preserve_power_state =
641+
let now = Date.now () |> Date.to_unix_time |> Int64.of_float in
640642
info "VM.export: VM = %s; preserve_power_state = '%s'"
641643
(string_of_vm ~__context vm_ref)
642644
(string_of_bool preserve_power_state) ;
@@ -646,7 +648,7 @@ let export refresh_session __context rpc session_id s vm_ref
646648
in
647649
debug "Outputting ova.xml" ;
648650
let hdr =
649-
Tar.Header.make Xapi_globs.ova_xml_filename
651+
Tar.Header.make ~mod_time:now Xapi_globs.ova_xml_filename
650652
(Int64.of_int @@ String.length ova_xml)
651653
in
652654
Tar_helpers.write_block hdr (fun s -> Unixext.really_write_string s ova_xml) s ;

0 commit comments

Comments
 (0)