aboutsummaryrefslogtreecommitdiff
path: root/block/qed.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qed.c')
-rw-r--r--block/qed.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/qed.c b/block/qed.c
index fa2aeee471..fd76817cbb 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -1526,11 +1526,12 @@ static int bdrv_qed_truncate(BlockDriverState *bs, int64_t offset, Error **errp)
if (!qed_is_image_size_valid(offset, s->header.cluster_size,
s->header.table_size)) {
+ error_setg(errp, "Invalid image size specified");
return -EINVAL;
}
- /* Shrinking is currently not supported */
if ((uint64_t)offset < s->header.image_size) {
+ error_setg(errp, "Shrinking images is currently not supported");
return -ENOTSUP;
}
@@ -1539,6 +1540,7 @@ static int bdrv_qed_truncate(BlockDriverState *bs, int64_t offset, Error **errp)
ret = qed_write_header_sync(s);
if (ret < 0) {
s->header.image_size = old_image_size;
+ error_setg_errno(errp, -ret, "Failed to update the image size");
}
return ret;
}