diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/qcow2.c | 5 | ||||
-rw-r--r-- | block/qed.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 1789af43d2..d992e7fac7 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1762,9 +1762,8 @@ static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp) ret = qcow2_open(bs, options, flags, &local_err); QDECREF(options); if (local_err) { - error_setg(errp, "Could not reopen qcow2 layer: %s", - error_get_pretty(local_err)); - error_free(local_err); + error_propagate(errp, local_err); + error_prepend(errp, "Could not reopen qcow2 layer: "); return; } else if (ret < 0) { error_setg_errno(errp, -ret, "Could not reopen qcow2 layer"); diff --git a/block/qed.c b/block/qed.c index 9b88895038..31f4cc9e60 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1611,9 +1611,8 @@ static void bdrv_qed_invalidate_cache(BlockDriverState *bs, Error **errp) memset(s, 0, sizeof(BDRVQEDState)); ret = bdrv_qed_open(bs, NULL, bs->open_flags, &local_err); if (local_err) { - error_setg(errp, "Could not reopen qed layer: %s", - error_get_pretty(local_err)); - error_free(local_err); + error_propagate(errp, local_err); + error_prepend(errp, "Could not reopen qed layer: "); return; } else if (ret < 0) { error_setg_errno(errp, -ret, "Could not reopen qed layer"); |