[Pkg-libvirt-commits] [libguestfs] 149/266: v2v: Pass verbose flag into every input and output subclass.
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:41:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.
commit c3dda31492c1d5f53b47278ae383c7d4ce8d86b3
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Thu Aug 21 13:35:59 2014 +0100
v2v: Pass verbose flag into every input and output subclass.
---
v2v/cmdline.ml | 12 ++++++------
v2v/input_disk.ml | 4 ++--
v2v/input_disk.mli | 2 +-
v2v/input_libvirt.ml | 11 ++++++-----
v2v/input_libvirt.mli | 4 ++--
v2v/output_RHEV.ml | 4 ++--
v2v/output_RHEV.mli | 2 +-
v2v/output_libvirt.ml | 4 ++--
v2v/output_libvirt.mli | 2 +-
v2v/output_local.ml | 4 ++--
v2v/output_local.mli | 2 +-
v2v/types.ml | 4 ++--
v2v/types.mli | 4 ++--
13 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
index 595d97a..bec6d51 100644
--- a/v2v/cmdline.ml
+++ b/v2v/cmdline.ml
@@ -211,7 +211,7 @@ read the man page virt-v2v(1).
| [disk] -> disk
| _ ->
error (f_"expecting a disk image (filename) on the command line") in
- Input_disk.input_disk input_format disk
+ Input_disk.input_disk verbose input_format disk
| `Libvirt ->
(* -i libvirt: Expecting a single argument which is the name
@@ -222,7 +222,7 @@ read the man page virt-v2v(1).
| [guest] -> guest
| _ ->
error (f_"expecting a libvirt guest name on the command line") in
- Input_libvirt.input_libvirt input_conn guest
+ Input_libvirt.input_libvirt verbose input_conn guest
| `LibvirtXML ->
(* -i libvirtxml: Expecting a filename (XML file). *)
@@ -231,7 +231,7 @@ read the man page virt-v2v(1).
| [filename] -> filename
| _ ->
error (f_"expecting a libvirt XML file name on the command line") in
- Input_libvirt.input_libvirtxml filename in
+ Input_libvirt.input_libvirtxml verbose filename in
(* Parse the output mode. *)
let output =
@@ -243,7 +243,7 @@ read the man page virt-v2v(1).
error (f_"--vmtype option can only be used with '-o rhev'");
if not do_copy then
error (f_"--no-copy and '-o libvirt' cannot be used at the same time");
- Output_libvirt.output_libvirt output_conn output_storage
+ Output_libvirt.output_libvirt verbose output_conn output_storage
| `Local ->
if output_storage = "" then
@@ -253,7 +253,7 @@ read the man page virt-v2v(1).
output_storage;
if vmtype <> None then
error (f_"--vmtype option can only be used with '-o rhev'");
- Output_local.output_local output_storage
+ Output_local.output_local verbose output_storage
| `RHEV ->
if output_storage = "" then
@@ -264,7 +264,7 @@ read the man page virt-v2v(1).
vm_uuid = rhev_vm_uuid;
vmtype = vmtype;
} in
- Output_RHEV.output_rhev ~verbose output_storage rhev_params output_alloc in
+ Output_RHEV.output_rhev verbose output_storage rhev_params output_alloc in
input, output,
debug_gc, do_copy, network_map,
diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml
index c0b2541..cc76e9c 100644
--- a/v2v/input_disk.ml
+++ b/v2v/input_disk.ml
@@ -24,8 +24,8 @@ open Common_utils
open Types
open Utils
-class input_disk input_format disk = object
- inherit input
+class input_disk verbose input_format disk = object
+ inherit input verbose
method as_options =
sprintf "-i disk%s %s"
diff --git a/v2v/input_disk.mli b/v2v/input_disk.mli
index 43f1f44..3d8d357 100644
--- a/v2v/input_disk.mli
+++ b/v2v/input_disk.mli
@@ -18,4 +18,4 @@
(** [-i disk] source. *)
-val input_disk : string option -> string -> Types.input
+val input_disk : bool -> string option -> string -> Types.input
diff --git a/v2v/input_libvirt.ml b/v2v/input_libvirt.ml
index 017bc48..f709a0d 100644
--- a/v2v/input_libvirt.ml
+++ b/v2v/input_libvirt.ml
@@ -27,9 +27,10 @@ open Utils
let identity x = x
class input_libvirt
+ verbose
options ?(map_source_file = identity) ?(map_source_dev = identity) xml =
object
- inherit input
+ inherit input verbose
method as_options = options
@@ -245,7 +246,7 @@ object
end
(* -i libvirtxml *)
-let input_libvirtxml file =
+let input_libvirtxml verbose file =
let options = "-i libvirtxml " ^ file in
let xml = read_whole_file file in
@@ -261,10 +262,10 @@ let input_libvirtxml file =
if not (Filename.is_relative path) then path else dir // path
in
- new input_libvirt options ~map_source_file xml
+ new input_libvirt verbose options ~map_source_file xml
(* -i libvirt [-ic libvirt_uri] *)
-let input_libvirt libvirt_uri guest =
+let input_libvirt verbose libvirt_uri guest =
let options =
sprintf "-i libvirt%s %s"
(match libvirt_uri with
@@ -312,4 +313,4 @@ let input_libvirt libvirt_uri guest =
let lines = external_command ~prog cmd in
let xml = String.concat "\n" lines in
- new input_libvirt options ?map_source_file ?map_source_dev xml
+ new input_libvirt verbose options ?map_source_file ?map_source_dev xml
diff --git a/v2v/input_libvirt.mli b/v2v/input_libvirt.mli
index 549a7a5..070ac39 100644
--- a/v2v/input_libvirt.mli
+++ b/v2v/input_libvirt.mli
@@ -18,6 +18,6 @@
(** [-i libvirt] and [-i libvirtxml] sources. *)
-val input_libvirt : string option -> string -> Types.input
+val input_libvirt : bool -> string option -> string -> Types.input
-val input_libvirtxml : string -> Types.input
+val input_libvirtxml : bool -> string -> Types.input
diff --git a/v2v/output_RHEV.ml b/v2v/output_RHEV.ml
index 45655b3..51daeba 100644
--- a/v2v/output_RHEV.ml
+++ b/v2v/output_RHEV.ml
@@ -55,9 +55,9 @@ let iso_time =
(tm.tm_year + 1900) (tm.tm_mon + 1) tm.tm_mday
tm.tm_hour tm.tm_min tm.tm_sec
-class output_rhev ~verbose os rhev_params output_alloc =
+class output_rhev verbose os rhev_params output_alloc =
object
- inherit output
+ inherit output verbose
method as_options =
sprintf "-o rhev -os %s%s%s%s%s" os
diff --git a/v2v/output_RHEV.mli b/v2v/output_RHEV.mli
index 1e3d4f1..e043e3a 100644
--- a/v2v/output_RHEV.mli
+++ b/v2v/output_RHEV.mli
@@ -26,4 +26,4 @@ type rhev_params = {
}
(** Miscellaneous extra command line parameters used by RHEV. *)
-val output_rhev : verbose:bool -> string -> rhev_params -> [`Sparse|`Preallocated] -> Types.output
+val output_rhev : bool -> string -> rhev_params -> [`Sparse|`Preallocated] -> Types.output
diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml
index 8403f5b..aaa3e4b 100644
--- a/v2v/output_libvirt.ml
+++ b/v2v/output_libvirt.ml
@@ -187,8 +187,8 @@ let create_libvirt_xml ?pool source overlays guestcaps =
doc
-class output_libvirt oc output_pool = object
- inherit output
+class output_libvirt verbose oc output_pool = object
+ inherit output verbose
method as_options =
match oc with
diff --git a/v2v/output_libvirt.mli b/v2v/output_libvirt.mli
index 34c9cee..06407f3 100644
--- a/v2v/output_libvirt.mli
+++ b/v2v/output_libvirt.mli
@@ -18,7 +18,7 @@
(** [-o libvirt] target. *)
-val output_libvirt : string option -> string -> Types.output
+val output_libvirt : bool -> string option -> string -> Types.output
val create_libvirt_xml : ?pool:string -> Types.source -> Types.overlay list -> Types.guestcaps -> DOM.doc
(** This is called from {!Output_local} to generate the libvirt XML. *)
diff --git a/v2v/output_local.ml b/v2v/output_local.ml
index e93afee..a8719d3 100644
--- a/v2v/output_local.ml
+++ b/v2v/output_local.ml
@@ -24,8 +24,8 @@ open Common_utils
open Types
open Utils
-class output_local dir = object
- inherit output
+class output_local verbose dir = object
+ inherit output verbose
method as_options = sprintf "-o local -os %s" dir
diff --git a/v2v/output_local.mli b/v2v/output_local.mli
index fb52676..71e7713 100644
--- a/v2v/output_local.mli
+++ b/v2v/output_local.mli
@@ -18,4 +18,4 @@
(** [-o local] target. *)
-val output_local : string -> Types.output
+val output_local : bool -> string -> Types.output
diff --git a/v2v/types.ml b/v2v/types.ml
index ab0e921..018045a 100644
--- a/v2v/types.ml
+++ b/v2v/types.ml
@@ -179,12 +179,12 @@ type output_rhev_params = {
vmtype : [`Server|`Desktop] option;
}
-class virtual input = object
+class virtual input verbose = object
method virtual as_options : string
method virtual source : unit -> source
end
-class virtual output = object
+class virtual output verbose = object
method virtual as_options : string
method virtual prepare_output : source -> overlay list -> overlay list
method virtual create_metadata : source -> overlay list -> guestcaps -> inspect -> unit
diff --git a/v2v/types.mli b/v2v/types.mli
index 20bf526..cf934ea 100644
--- a/v2v/types.mli
+++ b/v2v/types.mli
@@ -114,7 +114,7 @@ type guestcaps = {
}
(** Guest capabilities after conversion. eg. Was virtio found or installed? *)
-class virtual input : object
+class virtual input : bool -> object
method virtual as_options : string
(** Converts the input object back to the equivalent command line options.
This is just used for pretty-printing log messages. *)
@@ -123,7 +123,7 @@ class virtual input : object
end
(** Encapsulates all [-i], etc input arguments as an object. *)
-class virtual output : object
+class virtual output : bool -> object
method virtual as_options : string
(** Converts the output object back to the equivalent command line options.
This is just used for pretty-printing log messages. *)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list