Revision 6512a2a7

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
}
b/dma.h
37 37
BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
38 38
                                 QEMUSGList *sg, uint64_t sector,
39 39
                                 BlockDriverCompletionFunc *cb, void *opaque);
40
void dma_helper_init(void);
40 41

  
41 42
#endif
b/vl.c
5515 5515
    cpu_exec_init_all(tb_size * 1024 * 1024);
5516 5516

  
5517 5517
    bdrv_init();
5518
    dma_helper_init();
5518 5519

  
5519 5520
    /* we always create the cdrom drive, even if no disk is there */
5520 5521

  

Also available in: Unified diff