summaryrefslogtreecommitdiffstats
path: root/blockdev.c
diff options
context:
space:
mode:
authorPeter Maydell2020-05-05 17:46:37 +0200
committerPeter Maydell2020-05-05 17:46:37 +0200
commitea1329bb3a8d5cd25b70e3dbf73e7ded4d5ad756 (patch)
treed432b9112c080f23593c66efee6b9bec3dd0caa1 /blockdev.c
parentMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-05-04' into st... (diff)
parentblock/block-copy: use aio-task-pool API (diff)
downloadqemu-ea1329bb3a8d5cd25b70e3dbf73e7ded4d5ad756.tar.gz
qemu-ea1329bb3a8d5cd25b70e3dbf73e7ded4d5ad756.tar.xz
qemu-ea1329bb3a8d5cd25b70e3dbf73e7ded4d5ad756.zip
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-05-05' into staging
Block patches: - Asynchronous copying for block-copy (i.e., the backup job) - Allow resizing of qcow2 images when they have internal snapshots - iotests: Logging improvements for Python tests - iotest 153 fix, and block comment cleanups # gpg: Signature made Tue 05 May 2020 13:56:58 BST # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2020-05-05: (24 commits) block/block-copy: use aio-task-pool API block/block-copy: refactor task creation block/block-copy: add state pointer to BlockCopyTask block/block-copy: alloc task on each iteration block/block-copy: rename in-flight requests to tasks Fix iotest 153 block: Comment cleanups qcow2: Tweak comment about bitmaps vs. resize qcow2: Allow resize of images with internal snapshots block: Add blk_new_with_bs() helper iotests: use python logging for iotests.log() iotests: Mark verify functions as private iotest 258: use script_main iotests: add script_initialize iotests: add hmp helper with logging iotests: limit line length to 79 chars iotests: touch up log function signature iotests: drop pre-Python 3.4 compatibility code iotests: alphabetize standard imports iotests: add pylintrc file ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/blockdev.c b/blockdev.c
index 708d0c323f..b3c840ec03 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2711,7 +2711,6 @@ void qmp_block_resize(bool has_device, const char *device,
BlockBackend *blk = NULL;
BlockDriverState *bs;
AioContext *aio_context;
- int ret;
bs = bdrv_lookup_bs(has_device ? device : NULL,
has_node_name ? node_name : NULL,
@@ -2734,9 +2733,8 @@ void qmp_block_resize(bool has_device, const char *device,
goto out;
}
- blk = blk_new(bdrv_get_aio_context(bs), BLK_PERM_RESIZE, BLK_PERM_ALL);
- ret = blk_insert_bs(blk, bs, errp);
- if (ret < 0) {
+ blk = blk_new_with_bs(bs, BLK_PERM_RESIZE, BLK_PERM_ALL, errp);
+ if (!blk) {
goto out;
}