diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-02-26 07:01:08 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-02-26 07:01:08 +0000 |
commit | c5c6d7f81a6950d8e32a3b5a0bafd37bfa5a8e88 (patch) | |
tree | 792ffe6fdc9cfdc48c25f2da39b3a6877576eb16 /block/sheepdog.c | |
parent | 68b459eaa660be17d3547aa581502fe2c572c84f (diff) | |
parent | 33394884060b6501ef39b124eeaa111f61c59f7f (diff) | |
download | qemu-c5c6d7f81a6950d8e32a3b5a0bafd37bfa5a8e88.tar.gz qemu-c5c6d7f81a6950d8e32a3b5a0bafd37bfa5a8e88.tar.bz2 qemu-c5c6d7f81a6950d8e32a3b5a0bafd37bfa5a8e88.zip |
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-18' into staging
Clean up around error_get_pretty(), qerror_report_err()
# gpg: Signature made Wed Feb 18 10:10:07 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
* remotes/armbru/tags/pull-error-2015-02-18:
qemu-char: Avoid qerror_report_err() outside QMP command handlers
qemu-img: Avoid qerror_report_err() outside QMP command handlers
vl: Avoid qerror_report_err() outside QMP command handlers
tpm: Avoid qerror_report_err() outside QMP command handlers
numa: Avoid qerror_report_err() outside QMP command handlers
net: Avoid qerror_report_err() outside QMP command handlers
monitor: Avoid qerror_report_err() outside QMP command handlers
monitor: Clean up around monitor_handle_fd_param()
error: Use error_report_err() where appropriate
error: New convenience function error_report_err()
vhost-scsi: Improve error reporting for invalid vhostfd
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index b320871e9c..d17ee360c5 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -726,8 +726,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque) s->fd = get_sheep_fd(s, &local_err); if (s->fd < 0) { DPRINTF("Wait for connection to be established\n"); - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME, 1000000000ULL); } @@ -1283,8 +1282,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); return -EIO; } @@ -1292,8 +1290,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag) ret = find_vdi_name(s, s->name, snapid, tag, &vid, false, &local_err); if (ret) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); goto out; } @@ -1785,8 +1782,7 @@ static void sd_close(BlockDriverState *bs) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); return; } @@ -1838,8 +1834,7 @@ static int sd_truncate(BlockDriverState *bs, int64_t offset) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); return fd; } @@ -1912,8 +1907,7 @@ static bool sd_delete(BDRVSheepdogState *s) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); return false; } @@ -1960,8 +1954,7 @@ static int sd_create_branch(BDRVSheepdogState *s) deleted = sd_delete(s); ret = do_sd_create(s, &vid, !deleted, &local_err); if (ret) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); goto out; } @@ -1969,8 +1962,7 @@ static int sd_create_branch(BDRVSheepdogState *s) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); ret = fd; goto out; } @@ -2218,8 +2210,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) /* refresh inode. */ fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); ret = fd; goto cleanup; } @@ -2234,8 +2225,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) ret = do_sd_create(s, &new_vid, 1, &local_err); if (ret < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); error_report("failed to create inode for snapshot. %s", strerror(errno)); goto cleanup; @@ -2336,8 +2326,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); ret = fd; goto out; } @@ -2366,8 +2355,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab) fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); ret = fd; goto out; } @@ -2429,8 +2417,7 @@ static int do_load_save_vmstate(BDRVSheepdogState *s, uint8_t *data, fd = connect_to_sdog(s, &local_err); if (fd < 0) { - error_report("%s", error_get_pretty(local_err));; - error_free(local_err); + error_report_err(local_err); return fd; } |