summaryrefslogtreecommitdiffstats
path: root/contrib/ivshmem-server
diff options
context:
space:
mode:
authorMarkus Armbruster2015-12-18 16:35:07 +0100
committerMarkus Armbruster2016-01-13 15:16:16 +0100
commit782886719822c956e800dfb9c0665e2b301cb1fb (patch)
tree754470c7cfdebee6d0a0a10eba6a9c10c4bf1062 /contrib/ivshmem-server
parenterror: Use error_report_err() instead of monitor_printf() (diff)
downloadqemu-782886719822c956e800dfb9c0665e2b301cb1fb.tar.gz
qemu-782886719822c956e800dfb9c0665e2b301cb1fb.tar.xz
qemu-782886719822c956e800dfb9c0665e2b301cb1fb.zip
error: Use error_report_err() instead of ad hoc prints
Unlike ad hoc prints, error_report_err() uses the error whole instead of just its message obtained with error_get_pretty(). This avoids suppressing its hint (see commit 50b7b00). Example: $ bld/ivshmem-server -l 42@ Parameter 'shm_size' expects a size You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and terabytes. The last line is new with this patch. While there, drop a "cannot parse shm size: " message prefix; it's redundant, because the error message proper is always of the form "Parameter 'shm_size' expects ...". Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-5-git-send-email-armbru@redhat.com>
Diffstat (limited to 'contrib/ivshmem-server')
-rw-r--r--contrib/ivshmem-server/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index 54ff001c23..00508b5edd 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -106,9 +106,7 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int argc, char *argv[])
case 'l': /* shm_size */
parse_option_size("shm_size", optarg, &args->shm_size, &errp);
if (errp) {
- fprintf(stderr, "cannot parse shm size: %s\n",
- error_get_pretty(errp));
- error_free(errp);
+ error_report_err(errp);
ivshmem_server_usage(argv[0], 1);
}
break;