summaryrefslogtreecommitdiff
path: root/block/stream.c
diff options
context:
space:
mode:
authorAnthony Liguori <anthony@codemonkey.ws>2013-08-20 09:52:18 -0500
committerAnthony Liguori <anthony@codemonkey.ws>2013-08-20 09:52:18 -0500
commit9176e8fb8f78206bd4039f001aca0d931a47d663 (patch)
tree01b2298af04ffc11e0546cb88150286a36f6b26c /block/stream.c
parent72420ce9f0bafef7d55563a8bd14237a5fe88a87 (diff)
parentf2e5dca46b5ba4588c0756c5f272123585cbbf23 (diff)
downloadqemu-9176e8fb8f78206bd4039f001aca0d931a47d663.zip
Merge remote-tracking branch 'stefanha/block-next' into staging
# By Stefan Hajnoczi # Via Stefan Hajnoczi * stefanha/block-next: aio: drop io_flush argument tests: drop event_active_cb() thread-pool: drop thread_pool_active() dataplane/virtio-blk: drop flush_true() and flush_io() block/ssh: drop return_true() block/sheepdog: drop have_co_req() and aio_flush_request() block/rbd: drop qemu_rbd_aio_flush_cb() block/nbd: drop nbd_have_request() block/linux-aio: drop qemu_laio_completion_cb() block/iscsi: drop iscsi_process_flush() block/gluster: drop qemu_gluster_aio_flush_cb() block/curl: drop curl_aio_flush() aio: stop using .io_flush() tests: adjust test-thread-pool to new aio_poll() semantics tests: adjust test-aio to new aio_poll() semantics dataplane/virtio-blk: check exit conditions before aio_poll() block: stop relying on io_flush() in bdrv_drain_all() block: ensure bdrv_drain_all() works during bdrv_delete() Message-id: 1376921877-9576-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
Diffstat (limited to 'block/stream.c')
-rw-r--r--block/stream.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/block/stream.c b/block/stream.c
index 7fe9e486bf..db49b4d85f 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -57,6 +57,11 @@ static void close_unused_images(BlockDriverState *top, BlockDriverState *base,
BlockDriverState *intermediate;
intermediate = top->backing_hd;
+ /* Must assign before bdrv_delete() to prevent traversing dangling pointer
+ * while we delete backing image instances.
+ */
+ top->backing_hd = base;
+
while (intermediate) {
BlockDriverState *unused;
@@ -70,7 +75,6 @@ static void close_unused_images(BlockDriverState *top, BlockDriverState *base,
unused->backing_hd = NULL;
bdrv_delete(unused);
}
- top->backing_hd = base;
}
static void coroutine_fn stream_run(void *opaque)