mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
193227f9e5
commit
7828867198
3 changed files with 3 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue