Pino Toscano
2015-Feb-26 09:03 UTC
[Libguestfs] [PATCH] builder: handle -v and -x flags like in other tools (RHBZ#1196100)
Make sure that -x enables tracing and -v enables verbose mode, just like other tools do. Kind of followup of commit b6b9b90dd74c7b9204bdf218aa9360e117308e78. --- builder/builder.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index a519913..0ddf076 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -555,7 +555,8 @@ let main () let preallocation = if oformat = "qcow2" then Some "metadata" else None in let () let g = new G.guestfs () in - if verbose then ( g#set_trace true; g#set_verbose true ); + if trace then g#set_trace true; + if verbose then g#set_verbose true; g#disk_create ?preallocation ofile oformat osize in let cmd sprintf "virt-resize%s%s%s --output-format %s%s%s %s %s" @@ -608,7 +609,8 @@ let main () msg (f_"Opening the new disk"); let g let g = new G.guestfs () in - if verbose then g#set_trace true; + if trace then g#set_trace true; + if verbose then g#set_verbose true; (match memsize with None -> () | Some memsize -> g#set_memsize memsize); (match smp with None -> () | Some smp -> g#set_smp smp); -- 2.1.0
Richard W.M. Jones
2015-Feb-26 12:45 UTC
Re: [Libguestfs] [PATCH] builder: handle -v and -x flags like in other tools (RHBZ#1196100)
On Thu, Feb 26, 2015 at 10:03:07AM +0100, Pino Toscano wrote:> Make sure that -x enables tracing and -v enables verbose mode, just like > other tools do. > > Kind of followup of commit b6b9b90dd74c7b9204bdf218aa9360e117308e78. > --- > builder/builder.ml | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/builder/builder.ml b/builder/builder.ml > index a519913..0ddf076 100644 > --- a/builder/builder.ml > +++ b/builder/builder.ml > @@ -555,7 +555,8 @@ let main () > let preallocation = if oformat = "qcow2" then Some "metadata" else None in > let () > let g = new G.guestfs () in > - if verbose then ( g#set_trace true; g#set_verbose true ); > + if trace then g#set_trace true; > + if verbose then g#set_verbose true; > g#disk_create ?preallocation ofile oformat osize in > let cmd > sprintf "virt-resize%s%s%s --output-format %s%s%s %s %s" > @@ -608,7 +609,8 @@ let main () > msg (f_"Opening the new disk"); > let g > let g = new G.guestfs () in > - if verbose then g#set_trace true; > + if trace then g#set_trace true; > + if verbose then g#set_verbose true; > > (match memsize with None -> () | Some memsize -> g#set_memsize memsize); > (match smp with None -> () | Some smp -> g#set_smp smp);Yup - obviously bogus code. ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Apparently Analagous Threads
- [PATCH] OCaml tools: use open_guestfs everywhere
- [PATCH v3 10/13] v2v: factor out opening and populating guestfs handle
- [PATCH] v2v: move open_guestfs to Types
- [PATCH 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
- [PATCH v2 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.