From: Paolo Bonzini Date: Mon, 17 Feb 2014 13:43:56 +0000 (+0100) Subject: cow: correctly propagate errors X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~1027^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8d924e48167ec14ec4556441ec7999a30ef6640;p=sdk%2Femulator%2Fqemu.git cow: correctly propagate errors Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- diff --git a/block/cow.c b/block/cow.c index d0385be..9e4f624 100644 --- a/block/cow.c +++ b/block/cow.c @@ -82,7 +82,7 @@ static int cow_open(BlockDriverState *bs, QDict *options, int flags, char version[64]; snprintf(version, sizeof(version), "COW version %d", cow_header.version); - qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, + error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, bs->device_name, "cow", version); ret = -ENOTSUP; goto fail; @@ -346,8 +346,7 @@ static int cow_create(const char *filename, QEMUOptionParameter *options, ret = bdrv_create_file(filename, options, &local_err); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); return ret; } @@ -355,8 +354,7 @@ static int cow_create(const char *filename, QEMUOptionParameter *options, ret = bdrv_open(&cow_bs, filename, NULL, NULL, BDRV_O_RDWR | BDRV_O_PROTOCOL, NULL, &local_err); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); return ret; }