void migration_bitmap_extend(ram_addr_t old, ram_addr_t new)

{

    /* called in qemu main thread, so there is

     * no writing race against this migration_bitmap

     */

    if (migration_bitmap) {

        unsigned long *old_bitmap = migration_bitmap, *bitmap;

        bitmap = bitmap_new(new);



        /* prevent migration_bitmap content from being set bit

         * by migration_bitmap_sync_range() at the same time.

         * it is safe to migration if migration_bitmap is cleared bit

         * at the same time.

         */

        qemu_mutex_lock(&migration_bitmap_mutex);

        bitmap_copy(bitmap, old_bitmap, old);

        bitmap_set(bitmap, old, new - old);

        atomic_rcu_set(&migration_bitmap, bitmap);

        qemu_mutex_unlock(&migration_bitmap_mutex);

        migration_dirty_pages += new - old;

        synchronize_rcu();

        g_free(old_bitmap);

    }

}

void migration_bitmap_extend(ram_addr_t old, ram_addr_t new)

{

    





    if (migration_bitmap) {

        unsigned long *old_bitmap = migration_bitmap, *bitmap;

        bitmap = bitmap_new(new);



        









        qemu_mutex_lock(&migration_bitmap_mutex);

        bitmap_copy(bitmap, old_bitmap, old);

        bitmap_set(bitmap, old, new - old);

        atomic_rcu_set(&migration_bitmap, bitmap);

        qemu_mutex_unlock(&migration_bitmap_mutex);

        migration_dirty_pages += new - old;

        synchronize_rcu();

        g_free(old_bitmap);

    }

}

        synchronize_rcu();     if (migration_bitmap) {         unsigned long *old_bitmap = migration_bitmap, *bitmap;         bitmap = bitmap_new(new);         bitmap_copy(bitmap, old_bitmap, old);         bitmap_set(bitmap, old, new - old);         atomic_rcu_set(&migration_bitmap, bitmap);         synchronize_rcu();         g_free(old_bitmap);
void FUNC_0(ram_addr_t VAR_0, ram_addr_t VAR_1)

{

    





    if (migration_bitmap) {

        unsigned long *VAR_2 = migration_bitmap, *VAR_3;

        VAR_3 = bitmap_new(VAR_1);



        









        qemu_mutex_lock(&migration_bitmap_mutex);

        bitmap_copy(VAR_3, VAR_2, VAR_0);

        bitmap_set(VAR_3, VAR_0, VAR_1 - VAR_0);

        atomic_rcu_set(&migration_bitmap, VAR_3);

        qemu_mutex_unlock(&migration_bitmap_mutex);

        migration_dirty_pages += VAR_1 - VAR_0;

        synchronize_rcu();

        g_free(VAR_2);

    }

}

void FUNC_0(ram_addr_t VAR_0, ram_addr_t VAR_1)
{ if (migration_bitmap) { unsigned long *VAR_2 = migration_bitmap, *VAR_3; VAR_3 = bitmap_new(VAR_1); qemu_mutex_lock(&migration_bitmap_mutex); bitmap_copy(VAR_3, VAR_2, VAR_0); bitmap_set(VAR_3, VAR_0, VAR_1 - VAR_0); atomic_rcu_set(&migration_bitmap, VAR_3); qemu_mutex_unlock(&migration_bitmap_mutex); migration_dirty_pages += VAR_1 - VAR_0; synchronize_rcu(); g_free(VAR_2); } }