diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-12 13:55:05 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-02-18 10:51:09 +0100 |
commit | 565f65d271984a32eed2c324ff6ef8be33f7f3d2 (patch) | |
tree | 0adbc6737d2dc268c00166eb9b9dc89caa4ea28b /blockdev.c | |
parent | 2ee2f1e41517efa7b5dd604a68ceca9b1377de2c (diff) |
error: Use error_report_err() where appropriate
Coccinelle semantic patch:
@@
expression E;
@@
- error_report("%s", error_get_pretty(E));
- error_free(E);
+ error_report_err(E);
@@
expression E, S;
@@
- error_report("%s", error_get_pretty(E));
+ error_report_err(E);
(
exit(S);
|
abort();
)
Trivial manual touch-ups in block/sheepdog.c.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/blockdev.c b/blockdev.c index 7d34960b96..5437955fd8 100644 --- a/blockdev.c +++ b/blockdev.c @@ -728,8 +728,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type) qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); return NULL; } } @@ -767,8 +766,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type) &error_abort); qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); goto fail; } @@ -983,8 +981,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type) bs_opts = NULL; if (!blk) { if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); } goto fail; } else { @@ -1978,8 +1975,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) aio_context_acquire(aio_context); if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &local_err)) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); aio_context_release(aio_context); return -1; } |