提交 fbab9ccb 编写于 作者: M Markus Armbruster 提交者: Stefan Hajnoczi

block/sheepdog: Don't use qerror_report()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.
Replace by error_report().

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 efde4b62
...@@ -723,7 +723,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque) ...@@ -723,7 +723,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque)
s->fd = get_sheep_fd(s, &local_err); s->fd = get_sheep_fd(s, &local_err);
if (s->fd < 0) { if (s->fd < 0) {
DPRINTF("Wait for connection to be established\n"); DPRINTF("Wait for connection to be established\n");
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));
error_free(local_err); error_free(local_err);
co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME, co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME,
1000000000ULL); 1000000000ULL);
...@@ -1270,7 +1270,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag) ...@@ -1270,7 +1270,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
return -EIO; return -EIO;
} }
...@@ -1279,7 +1279,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag) ...@@ -1279,7 +1279,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); ret = find_vdi_name(s, s->name, snapid, tag, &vid, false, &local_err);
if (ret) { if (ret) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
goto out; goto out;
} }
...@@ -1753,7 +1753,7 @@ static void sd_close(BlockDriverState *bs) ...@@ -1753,7 +1753,7 @@ static void sd_close(BlockDriverState *bs)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
return; return;
} }
...@@ -1804,7 +1804,7 @@ static int sd_truncate(BlockDriverState *bs, int64_t offset) ...@@ -1804,7 +1804,7 @@ static int sd_truncate(BlockDriverState *bs, int64_t offset)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
return fd; return fd;
} }
...@@ -1877,7 +1877,7 @@ static bool sd_delete(BDRVSheepdogState *s) ...@@ -1877,7 +1877,7 @@ static bool sd_delete(BDRVSheepdogState *s)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
return false; return false;
} }
...@@ -1924,7 +1924,7 @@ static int sd_create_branch(BDRVSheepdogState *s) ...@@ -1924,7 +1924,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
deleted = sd_delete(s); deleted = sd_delete(s);
ret = do_sd_create(s, &vid, !deleted, &local_err); ret = do_sd_create(s, &vid, !deleted, &local_err);
if (ret) { if (ret) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
goto out; goto out;
} }
...@@ -1933,7 +1933,7 @@ static int sd_create_branch(BDRVSheepdogState *s) ...@@ -1933,7 +1933,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
ret = fd; ret = fd;
goto out; goto out;
...@@ -2180,7 +2180,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) ...@@ -2180,7 +2180,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
/* refresh inode. */ /* refresh inode. */
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
ret = fd; ret = fd;
goto cleanup; goto cleanup;
...@@ -2195,7 +2195,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) ...@@ -2195,7 +2195,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
ret = do_sd_create(s, &new_vid, 1, &local_err); ret = do_sd_create(s, &new_vid, 1, &local_err);
if (ret < 0) { if (ret < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
error_report("failed to create inode for snapshot. %s", error_report("failed to create inode for snapshot. %s",
strerror(errno)); strerror(errno));
...@@ -2297,7 +2297,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab) ...@@ -2297,7 +2297,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
ret = fd; ret = fd;
goto out; goto out;
...@@ -2326,7 +2326,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab) ...@@ -2326,7 +2326,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
ret = fd; ret = fd;
goto out; goto out;
...@@ -2388,7 +2388,7 @@ static int do_load_save_vmstate(BDRVSheepdogState *s, uint8_t *data, ...@@ -2388,7 +2388,7 @@ static int do_load_save_vmstate(BDRVSheepdogState *s, uint8_t *data,
fd = connect_to_sdog(s, &local_err); fd = connect_to_sdog(s, &local_err);
if (fd < 0) { if (fd < 0) {
qerror_report_err(local_err); error_report("%s", error_get_pretty(local_err));;
error_free(local_err); error_free(local_err);
return fd; return fd;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册