aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMiroslav Rezanina <mrezanin@redhat.com>2013-02-13 09:09:40 +0100
committerKevin Wolf <kwolf@redhat.com>2013-02-22 21:21:09 +0100
commitf382d43a9180ed20c671dc058d5452c2df7d3c61 (patch)
tree728a63b0aa4f28c97ea8e6d8fa3f7a4e3189df6b /block.c
parentb35b2bba5b372ff912c5fe7e5ad6c5a9d883464f (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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/block.c b/block.c
index 08039d2f32..a4d7125eec 100644
--- a/block.c
+++ b/block.c
@@ -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) {