aboutsummaryrefslogtreecommitdiff
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-12-18 16:35:07 +0100
committerMarkus Armbruster <armbru@redhat.com>2016-01-13 15:16:16 +0100
commit782886719822c956e800dfb9c0665e2b301cb1fb (patch)
tree754470c7cfdebee6d0a0a10eba6a9c10c4bf1062 /qemu-nbd.c
parent193227f9e565803b1167fa01301bdf9f6d294d6a (diff)
downloadqemu-782886719822c956e800dfb9c0665e2b301cb1fb.zip
qemu-782886719822c956e800dfb9c0665e2b301cb1fb.tar.gz
qemu-782886719822c956e800dfb9c0665e2b301cb1fb.tar.bz2
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 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 65c0ebd..706552e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -251,8 +251,7 @@ static void *nbd_client_thread(void *arg)
&size, &local_error);
if (ret < 0) {
if (local_error) {
- fprintf(stderr, "%s\n", error_get_pretty(local_error));
- error_free(local_error);
+ error_report_err(local_error);
}
goto out_socket;
}