Displaying 20 results from an estimated 26 matches for "qemu_input_filename".
2018 May 22
1
[PATCH] v2v: Use Std_utils.qemu_input_filename instead of prefixing "file:" to filename (RHBZ#1580292).
...699701 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -744,7 +744,7 @@ and copy_targets cmdline targets input output =
let cmd =
let filename =
match t.target_file with
- | TargetFile filename -> "file:" ^ filename
+ | TargetFile filename -> qemu_input_filename filename
| TargetURI uri -> uri in
[ Guestfs_config.qemu_img; "convert" ] @
(if not (quiet ()) then [ "-p" ] else []) @
--
2.16.2
2015 Jan 16
2
[PATCH 1/2] mllib: add simple qemu filename sanitizing function
...mg.
+ *
+ * If the filename is something like "file:foo" then qemu-img will
+ * try to interpret that as "foo" in the file:/// protocol. To
+ * avoid that, if the path is relative prefix it with "./" since
+ * qemu-img won't try to interpret such a path.
+ *)
+let qemu_input_filename filename =
+ if String.length filename > 0 && filename.[0] <> '/' then
+ "./" ^ filename
+ else
+ filename
diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli
index 2103ff1..e59d802 100644
--- a/mllib/common_utils.mli
+++ b/mllib/common_utils.mli...
2019 Apr 30
1
[PATCH] v2v: Allow output modes to rewrite disk copying
...ing * overlay) list -> target_buses -> guestcaps -> inspect -> target_firmware -> target_file list
method disk_create = (open_guestfs ())#disk_create
+ method disk_copy target compressed =
+ let filename =
+ match target.target_file with
+ | TargetFile filename -> qemu_input_filename filename
+ | TargetURI uri -> uri in
+ let cmd =
+ [ "qemu-img"; "convert" ] @
+ (if not (quiet ()) then [ "-p" ] else []) @
+ [ "-n"; "-f"; "qcow2"; "-O"; target.target_format ] @
+ (if compressed...
2015 Jan 16
0
[PATCH 2/2] sparsify: handle output filenames with ':'
...edb76ad8ba8ff the checks for
input and output files with ':' were removed; while the input file is
handled correctly by the disk_create API, an output filename with ':'
could still be handled as specifying a transport, failing the last
"qemu-img convert" call.
Use the new qemu_input_filename helper to handle the output filename
correctly.
---
sparsify/copying.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sparsify/copying.ml b/sparsify/copying.ml
index 3628b01..d4861f9 100644
--- a/sparsify/copying.ml
+++ b/sparsify/copying.ml
@@ -311,7 +311,7 @@ You can ignore...
2015 Feb 23
3
[PATCH 1/2] mllib: add helper mkdir_p
...ike `mkdir -p`.
---
mllib/common_utils.ml | 11 +++++++++++
mllib/common_utils.mli | 3 +++
2 files changed, 14 insertions(+)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 898be17..76d8b79 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -673,3 +673,14 @@ let qemu_input_filename filename =
"./" ^ filename
else
filename
+
+let rec mkdir_p path permissions =
+ try Unix.mkdir path permissions
+ with
+ | Unix.Unix_error (Unix.EEXIST, _, _) -> ()
+ | Unix.Unix_error (Unix.ENOENT, _, _) ->
+ (* A component in the path does not exist, so first...
2016 May 23
0
[PATCH 5/5] mllib: add a new run_command helper
...essed then " -c" else "")
- tmpdiskfmt
- (quote tmpdisk)
- fmt
- (match cmdline.qemu_img_options with
- | None -> ""
- | Some opt -> " -o " ^ quote opt)
- (quote (qemu_input_filename fn)) in
- if debug >= 1 then
- printf "%s\n%!" cmd;
- run_command cmd
+ let cmd = [ "qemu-img"; "convert" ] @
+ (if cmdline.compressed then [ "-c" ] else []) @
+ [ "-f"; tmpdiskfmt; tmpd...
2016 May 23
7
[PATCH 1/5] mllib: make external_command echo the command executed
Add an optional parameter to disable this behaviour, so the Curl module
in v2v won't print user-sensible data (like passwords).
---
builder/checksums.ml | 1 -
builder/downloader.ml | 1 -
builder/sigchecker.ml | 1 -
mllib/common_utils.ml | 4 +++-
mllib/common_utils.mli | 7 +++++--
v2v/curl.ml | 2 +-
6 files changed, 9 insertions(+), 7 deletions(-)
diff --git
2015 Aug 11
3
[PATCH 1/2] mllib: add normalize_arch helper
...t;, "i386" -> true
| _ -> false
(** Return the last part of a string, after the specified separator. *)
diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli
index 16834f7..ac232af 100644
--- a/mllib/common_utils.mli
+++ b/mllib/common_utils.mli
@@ -175,6 +175,11 @@ val qemu_input_filename : string -> string
val mkdir_p : string -> int -> unit
(** Creates a directory, and its parents if missing. *)
+val normalize_arch : string -> string
+(** Normalize the architecture name, i.e. maps it into a defined
+ identifier for it -- e.g. i386, i486, i586, and i686 are
+...
2015 May 15
3
[PATCH v2 0/2] customize: Allow --selinux-relabel flag to work on cross-architecture builds.
Fixes
https://bugzilla.redhat.com/show_bug.cgi?id=1212807
Since v1:
- Combine the virt-builder detection code into virt-customize.
- Enables us to delete Architecture and Uname modules completely.
Rich.
2015 Nov 11
2
[PATCH 1/2] dib: Make the interface between cmdline.ml and dib.ml explicit.
...)
tmpdiskfmt
(quote tmpdisk)
fmt
- (match qemu_img_options with
+ (match cmdline.qemu_img_options with
| None -> ""
| Some opt -> " -o " ^ quote opt)
(quote (qemu_input_filename fn)) in
--
2.5.0
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
..."%s\n%!" cmd;
+ debug "%s" cmd;
if Sys.command cmd <> 0 then exit 1
| itags, `Convert, otags ->
@@ -628,7 +628,7 @@ let main () =
| Some iformat -> sprintf " -f %s" (quote iformat))
(quote ifile) (quote oformat) (quote (qemu_input_filename ofile))
(if verbose () then "" else " >/dev/null 2>&1") in
- if verbose () then printf "%s\n%!" cmd;
+ debug "%s" cmd;
if Sys.command cmd <> 0 then exit 1
) plan;
diff --git a/builder/checksums.ml b/builder/check...
2016 May 22
4
ocaml tools: Use a common debug function.
Add a Common_utils.debug function for printing messages
only when in verbose mode.
Rich.
2017 Feb 02
7
[PATCH 0/6] dib: various improvements
Hi,
this series improves virt-dib, adding some upstream changes, and
refactoring the handling of output formats.
Thanks,
Pino Toscano (6):
dib: clear up "already provided" message
dib: add --checksum
dib: pass custom mkfs options after the filesystem type
dib: refactor output formats handling
dib: clarify "output:" lines in --machine-readable documentation
dib:
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...> false
+
+(* Annoyingly Sys.is_directory throws an exception on failure
+ * (RHBZ#1022431).
+ *)
+let is_directory path =
+ try Sys.is_directory path
+ with Sys_error _ -> false
+
+let absolute_path path =
+ if not (Filename.is_relative path) then path
+ else Sys.getcwd () // path
+
+let qemu_input_filename filename =
+ (* If the filename is something like "file:foo" then qemu-img will
+ * try to interpret that as "foo" in the file:/// protocol. To
+ * avoid that, if the path is relative prefix it with "./" since
+ * qemu-img won't try to interpret such a path...
2016 Dec 18
9
[PATCH v4 0/6] Import directly from OVA tar archive if possible
v4:
- rebase to more recent master
- 1/6: using just "quote" instead of "Filename.quote"
- 2/6: reformated block of code according to Richards suggestion
- 4/6: added tests for nsplit
v3: Addressed Pino's comments, namely:
- input_ova.ml
- untar takes list of paths
- renamed untar_partial to untar_metadata
- replaced uggly regex with nsplit
- tests
- test changes
2015 May 29
0
[PATCH v3] RFC: New virt-dib tool
...if compressed then " -c" else "")
+ tmpdiskfmt
+ (quote tmpdisk)
+ fmt
+ (match qemu_img_options with
+ | None -> ""
+ | Some opt -> " -o " ^ quote opt)
+ (quote (qemu_input_filename fn)) in
+ if debug >= 1 then
+ printf "%s\n%!" cmd;
+ run_command cmd
+ | "vhd" ->
+ let fn_intermediate = Filename.temp_file ~temp_dir:tmpdir "vhd-intermediate." "" in
+ let cmd =
+ sprin...
2015 Jul 03
1
[PATCH v5] New tool: virt-dib
...if compressed then " -c" else "")
+ tmpdiskfmt
+ (quote tmpdisk)
+ fmt
+ (match qemu_img_options with
+ | None -> ""
+ | Some opt -> " -o " ^ quote opt)
+ (quote (qemu_input_filename fn)) in
+ if debug >= 1 then
+ printf "%s\n%!" cmd;
+ run_command cmd
+ | "vhd" ->
+ let fn_intermediate = Filename.temp_file ~temp_dir:tmpdir "vhd-intermediate." "" in
+ let cmd =
+ sprin...
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
I believe this addresses everything raised in comments on that
patch series.
Rich.
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought.
We have lots of utility functions, spread all over the repository,
with not a lot of structure. This moves many of them under common/
and structures them so there are clear dependencies.
This doesn't complete the job by any means. Other items I had on my
to-do list for this change were:
- Split up mllib/common_utils into:
-
2015 Jun 16
2
[PATCH v4] RFC: New tool: virt-dib
...if compressed then " -c" else "")
+ tmpdiskfmt
+ (quote tmpdisk)
+ fmt
+ (match qemu_img_options with
+ | None -> ""
+ | Some opt -> " -o " ^ quote opt)
+ (quote (qemu_input_filename fn)) in
+ if debug >= 1 then
+ printf "%s\n%!" cmd;
+ run_command cmd
+ | "vhd" ->
+ let fn_intermediate = Filename.temp_file ~temp_dir:tmpdir "vhd-intermediate." "" in
+ let cmd =
+ sprin...