[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/9] dma-helpers: dma_blk_io() cancel support
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 2/9] dma-helpers: dma_blk_io() cancel support |
Date: |
Tue, 28 Jun 2016 14:23:24 +0100 |
Attempting to cancel a dma_blk_io() request causes an abort(3):
void bdrv_aio_cancel(BlockAIOCB *acb)
{
...
while (acb->refcnt > 1) {
if (acb->aiocb_info->get_aio_context) {
aio_poll(acb->aiocb_info->get_aio_context(acb), true);
} else if (acb->bs) {
aio_poll(bdrv_get_aio_context(acb->bs), true);
} else {
abort();
}
}
...
}
This happens because DMAAIOCB->bs is NULL and
dma_aiocb_info.get_aio_context() is also NULL.
This patch trivially implements dma_aiocb_info.get_aio_context() by
fetching the DMAAIOCB->ctx field.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
dma-helpers.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dma-helpers.c b/dma-helpers.c
index b521d84..9defc10 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -185,10 +185,17 @@ static void dma_aio_cancel(BlockAIOCB *acb)
}
}
+static AioContext *dma_get_aio_context(BlockAIOCB *acb)
+{
+ DMAAIOCB *dbs = container_of(acb, DMAAIOCB, common);
+
+ return dbs->ctx;
+}
static const AIOCBInfo dma_aiocb_info = {
.aiocb_size = sizeof(DMAAIOCB),
.cancel_async = dma_aio_cancel,
+ .get_aio_context = dma_get_aio_context,
};
BlockAIOCB *dma_blk_io(AioContext *ctx,
--
2.7.4
- [Qemu-devel] [PULL 0/9] Block patches, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 1/9] Revert "virtio: sync the dataplane vring state to the virtqueue before virtio_save", Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 4/9] virtio-blk: multiqueue batch notify, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 5/9] virtio-blk: tell dataplane which vq to notify, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 2/9] dma-helpers: dma_blk_io() cancel support,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 6/9] virtio-blk: associate request with a virtqueue, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 7/9] virtio-blk: live migrate s->rq with multiqueue, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 3/9] virtio-blk: add VirtIOBlockConf->num_queues, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 9/9] virtio-blk: add num-queues device property, Stefan Hajnoczi, 2016/06/28
- [Qemu-devel] [PULL 8/9] virtio-blk: dataplane multiqueue support, Stefan Hajnoczi, 2016/06/28
- Re: [Qemu-devel] [PULL 0/9] Block patches, Peter Maydell, 2016/06/28