Revision 6512a2a7 dma-helpers.c
b/dma-helpers.c | ||
---|---|---|
10 | 10 |
#include "dma.h" |
11 | 11 |
#include "block_int.h" |
12 | 12 |
|
13 |
static AIOPool dma_aio_pool; |
|
14 |
|
|
13 | 15 |
void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint) |
14 | 16 |
{ |
15 | 17 |
qsg->sg = qemu_malloc(alloc_hint * sizeof(ScatterGatherEntry)); |
... | ... | |
126 | 128 |
DMABlockState *dbs = qemu_malloc(sizeof(*dbs)); |
127 | 129 |
|
128 | 130 |
dbs->bs = bs; |
129 |
dbs->acb = qemu_aio_get(bs, cb, opaque);
|
|
131 |
dbs->acb = qemu_aio_get_pool(&dma_aio_pool, bs, cb, opaque);
|
|
130 | 132 |
dbs->sg = sg; |
131 | 133 |
dbs->sector_num = sector_num; |
132 | 134 |
dbs->sg_cur_index = 0; |
... | ... | |
153 | 155 |
return dma_bdrv_io(bs, sg, sector, cb, opaque, 1); |
154 | 156 |
} |
155 | 157 |
|
158 |
static void dma_aio_cancel(BlockDriverAIOCB *acb) |
|
159 |
{ |
|
160 |
DMABlockState *dbs = (DMABlockState *)acb->opaque; |
|
161 |
|
|
162 |
bdrv_aio_cancel(dbs->acb); |
|
163 |
} |
|
164 |
|
|
165 |
void dma_helper_init(void) |
|
166 |
{ |
|
167 |
aio_pool_init(&dma_aio_pool, sizeof(BlockDriverAIOCB), dma_aio_cancel); |
|
168 |
} |
Also available in: Unified diff