[Libguestfs] [PATCH 5/5] mllib: add a new run_command helper
Richard W.M. Jones
rjones at redhat.com
Tue May 24 08:02:47 UTC 2016
On Mon, May 23, 2016 at 06:25:17PM +0200, Pino Toscano wrote:
> Add a simple helper to run a command from a sequence of arguments,
> without using a shell: this should help reducing the amount of quoting
> ineeded, since arguments are passed straight as such.
>
> Make use of it in the places currently using shell_command, and which
> don't assume they can run anything (so no shell redirections, `env`,
> etc).
> ---
> builder/builder.ml | 62 ++++++++++++++++++--------------------
> builder/cache.ml | 4 +--
> builder/downloader.ml | 8 ++---
> builder/sigchecker.ml | 4 +--
> dib/dib.ml | 57 ++++++++++++++---------------------
> dib/utils.ml | 6 ++--
> mllib/common_utils.ml | 15 +++++++++
> mllib/common_utils.mli | 6 ++++
> v2v/copy_to_local.ml | 4 +--
> v2v/input_libvirt_vcenter_https.ml | 7 ++---
> v2v/input_ova.ml | 12 ++++----
> v2v/output_glance.ml | 23 +++++++-------
> v2v/output_libvirt.ml | 15 ++++-----
> v2v/output_rhev.ml | 9 +++---
> v2v/v2v.ml | 21 ++++++-------
> 15 files changed, 124 insertions(+), 129 deletions(-)
My feeling is the use of an array parameter is a little bit
awkward here. It might be better to have the interface using
a list, and only convert it to an array in one place (in the
implementation in Common_utils). Anyway, up to you.
ACK series, with the changes I noted in the other replies.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
More information about the Libguestfs
mailing list