Displaying 5 results from an estimated 5 matches for "chop_suffix".
2016 Aug 08
1
[PATCH v2] v2v: disk: strip only common extension (RHBZ#1365005)
...for disk images. *)
+ let suffixes = [
+ ".img"; ".qcow2"; ".raw"; ".vmdk";
+ "-sda";
+ ] in
+ let rec loop = function
+ | suff :: xs ->
+ if Filename.check_suffix name suff then
+ Filename.chop_suffix name suff
+ else
+ loop xs
+ | [] -> name
+ in
+ loop suffixes in
if name = "" then
error (f_"-i disk: invalid input filename (%s)") disk;
--
2.7.4
2016 Sep 09
0
[PATCH 1/2] v2v: -i disk: Move code that creates name from disk to separate module.
...for disk images. *)
- let suffixes = [
- ".img"; ".qcow2"; ".raw"; ".vmdk";
- "-sda";
- ] in
- let rec loop = function
- | suff :: xs ->
- if Filename.check_suffix name suff then
- Filename.chop_suffix name suff
- else
- loop xs
- | [] -> name
- in
- loop suffixes in
- if name = "" then
- error (f_"-i disk: invalid input filename (%s)") disk;
+ let name = name_from_disk disk in
(* Get the absolute path to the disk file....
2016 Sep 09
5
[PATCH 0/2] v2v: -i ova: Derive the name from the OVA filename.
Don't use "default", choose a better default name if <Name> is not
present in the OVF.
Rich.
2015 Mar 10
0
[PATCH] v2v: Add the test-harness used by external tests.
...files: %s, %s: you are probably running the test script from the wrong directory" input_disk input_xml;
+
+ (* Uncompress the input, if it doesn't exist already. *)
+ let input_disk =
+ if Filename.check_suffix input_disk ".xz" then (
+ let input_disk_uncomp = Filename.chop_suffix input_disk ".xz" in
+ if not (Sys.file_exists input_disk_uncomp) then (
+ let cmd = sprintf "unxz --keep %s" (quote input_disk) in
+ printf "%s\n%!" cmd;
+ if Sys.command cmd <> 0 then
+ failwith "unxz command failed"...
2015 Mar 10
2
[PATCH 0/1] v2v: Add the test-harness used by external tests.
As I'm now working through the enormous virt-v2v/virt-p2v bug list, we
need a high quality set of tests to ensure that we don't accidentally
regress some old OS/hypervisor combination while making changes.
The test cases are going to be huge, so we cannot possibly distribute
them in libguestfs. Furthermore many of them have licensing problems
which means we cannot redistribute them at