Completes the conversion to Error started in commit 015a103^..d5124c0. Cc: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp> Signed-off-by: Markus Armbruster <arm...@redhat.com> --- block/sheepdog.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c index 2cf192d..cd5981e 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1391,8 +1391,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, options, &local_err); if (local_err) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); ret = -EINVAL; goto out; } @@ -1415,18 +1414,14 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, if (ret < 0) { goto out; } - s->fd = get_sheep_fd(s, &local_err); + s->fd = get_sheep_fd(s, errp); if (s->fd < 0) { - qerror_report_err(local_err); - error_free(local_err); ret = s->fd; goto out; } - ret = find_vdi_name(s, vdi, snapid, tag, &vid, true, &local_err); + ret = find_vdi_name(s, vdi, snapid, tag, &vid, true, errp); if (ret) { - qerror_report_err(local_err); - error_free(local_err); goto out; } @@ -1445,10 +1440,8 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, s->is_snapshot = true; } - fd = connect_to_sdog(s, &local_err); + fd = connect_to_sdog(s, errp); if (fd < 0) { - qerror_report_err(local_err); - error_free(local_err); ret = fd; goto out; } @@ -1648,7 +1641,6 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, char tag[SD_MAX_VDI_TAG_LEN]; uint32_t snapid; bool prealloc = false; - Error *local_err = NULL; s = g_malloc0(sizeof(BDRVSheepdogState)); @@ -1710,10 +1702,8 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, bs = NULL; ret = bdrv_open(&bs, backing_file, NULL, NULL, BDRV_O_PROTOCOL, NULL, - &local_err); + errp); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); goto out; } @@ -1729,19 +1719,13 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, bdrv_unref(bs); } - ret = do_sd_create(s, &vid, 0, &local_err); + ret = do_sd_create(s, &vid, 0, errp); if (ret) { - qerror_report_err(local_err); - error_free(local_err); goto out; } if (prealloc) { - ret = sd_prealloc(filename, &local_err); - if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); - } + ret = sd_prealloc(filename, errp); } out: g_free(s); -- 1.8.1.4