Hello everyone,

in QEMU 1.5.1, block-migration.c, there is a function below:

static void alloc_aio_bitmap(BlkMigDevState *bmds)
{
    BlockDriverState *bs = bmds->bs;
    int64_t bitmap_size;

    bitmap_size = (bdrv_getlength(bs) >> BDRV_SECTOR_BITS) +
            BDRV_SECTORS_PER_DIRTY_CHUNK * 8 - 1;
    bitmap_size /= BDRV_SECTORS_PER_DIRTY_CHUNK * 8;

    bmds->aio_bitmap = g_malloc0(bitmap_size);
}

I do not understand the calculation for the bitmap_size. Could someone explain it for me? 

Also, what's the difference between aio_bitmap and dirty_bitmap? How to calculate the size for dirty_bitmap?

Thanks!

Yaodong

Reply via email to