diff options
author | Miroslav Rezanina <mrezanin@redhat.com> | 2013-02-13 09:09:40 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-02-22 21:21:09 +0100 |
commit | f382d43a9180ed20c671dc058d5452c2df7d3c61 (patch) | |
tree | 728a63b0aa4f28c97ea8e6d8fa3f7a4e3189df6b /block.c | |
parent | b35b2bba5b372ff912c5fe7e5ad6c5a9d883464f (diff) |
qemu-img: Add "Quiet mode" option
There can be a need to turn output to stdout off. This patch adds a -q option
that enable "Quiet mode". In Quiet mode, only errors are printed out.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -4470,7 +4470,8 @@ bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie) void bdrv_img_create(const char *filename, const char *fmt, const char *base_filename, const char *base_fmt, - char *options, uint64_t img_size, int flags, Error **errp) + char *options, uint64_t img_size, int flags, + Error **errp, bool quiet) { QEMUOptionParameter *param = NULL, *create_options = NULL; QEMUOptionParameter *backing_fmt, *backing_file, *size; @@ -4579,10 +4580,11 @@ void bdrv_img_create(const char *filename, const char *fmt, } } - printf("Formatting '%s', fmt=%s ", filename, fmt); - print_option_parameters(param); - puts(""); - + if (!quiet) { + printf("Formatting '%s', fmt=%s ", filename, fmt); + print_option_parameters(param); + puts(""); + } ret = bdrv_create(drv, filename, param); if (ret < 0) { if (ret == -ENOTSUP) { |