summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2014-06-25 16:55:30 -0400
committerKevin Wolf <kwolf@redhat.com>2014-06-27 11:37:35 +0200
commit9c75e168bc388094c04aabb6fc59c91abe06e81c (patch)
tree1ffb1180562aa96b5217310a33c27d041778f558 /block.c
parenta760715095e9cda6eb97486c040aa35f82297945 (diff)
downloadqemu-9c75e168bc388094c04aabb6fc59c91abe06e81c.tar.gz
block: check for RESIZE blocker in the QMP command, not bdrv_truncate()
If we check for the RESIZE blocker in bdrv_truncate(), that means a commit will fail if the overlay layer is larger than the base, due to the backing blocker. This is a regression in behavior from 2.0; currently, commit will try to grow the size of the base image to match the overlay size, if the overlay size is larger. By moving this into the QMP command qmp_block_resize(), it allows usage of bdrv_truncate() within block jobs. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/block.c b/block.c
index 7d69f312b6..106238d0b7 100644
--- a/block.c
+++ b/block.c
@@ -3483,9 +3483,7 @@ int bdrv_truncate(BlockDriverState *bs, int64_t offset)
return -ENOTSUP;
if (bs->read_only)
return -EACCES;
- if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) {
- return -EBUSY;
- }
+
ret = drv->bdrv_truncate(bs, offset);
if (ret == 0) {
ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);