static void blk_send(QEMUFile *f, BlkMigBlock * blk)

{

    int len;

    uint64_t flags = BLK_MIG_FLAG_DEVICE_BLOCK;



    if (block_mig_state.zero_blocks &&

        buffer_is_zero(blk->buf, BLOCK_SIZE)) {

        flags |= BLK_MIG_FLAG_ZERO_BLOCK;

    }



    /* sector number and flags */

    qemu_put_be64(f, (blk->sector << BDRV_SECTOR_BITS)

                     | flags);



    /* device name */

    len = strlen(bdrv_get_device_name(blk->bmds->bs));

    qemu_put_byte(f, len);

    qemu_put_buffer(f, (uint8_t *)bdrv_get_device_name(blk->bmds->bs), len);



    /* if a block is zero we need to flush here since the network

     * bandwidth is now a lot higher than the storage device bandwidth.

     * thus if we queue zero blocks we slow down the migration */

    if (flags & BLK_MIG_FLAG_ZERO_BLOCK) {

        qemu_fflush(f);

        return;

    }



    qemu_put_buffer(f, blk->buf, BLOCK_SIZE);

}

static void blk_send(QEMUFile *f, BlkMigBlock * blk)

{

    int len;

    uint64_t flags = BLK_MIG_FLAG_DEVICE_BLOCK;



    if (block_mig_state.zero_blocks &&

        buffer_is_zero(blk->buf, BLOCK_SIZE)) {

        flags |= BLK_MIG_FLAG_ZERO_BLOCK;

    }



    

    qemu_put_be64(f, (blk->sector << BDRV_SECTOR_BITS)

                     | flags);



    

    len = strlen(bdrv_get_device_name(blk->bmds->bs));

    qemu_put_byte(f, len);

    qemu_put_buffer(f, (uint8_t *)bdrv_get_device_name(blk->bmds->bs), len);



    





    if (flags & BLK_MIG_FLAG_ZERO_BLOCK) {

        qemu_fflush(f);

        return;

    }



    qemu_put_buffer(f, blk->buf, BLOCK_SIZE);

}

static void FUNC_0(QEMUFile *VAR_0, BlkMigBlock * VAR_1)

{

    int VAR_2;

    uint64_t flags = BLK_MIG_FLAG_DEVICE_BLOCK;



    if (block_mig_state.zero_blocks &&

        buffer_is_zero(VAR_1->buf, BLOCK_SIZE)) {

        flags |= BLK_MIG_FLAG_ZERO_BLOCK;

    }



    

    qemu_put_be64(VAR_0, (VAR_1->sector << BDRV_SECTOR_BITS)

                     | flags);



    

    VAR_2 = strlen(bdrv_get_device_name(VAR_1->bmds->bs));

    qemu_put_byte(VAR_0, VAR_2);

    qemu_put_buffer(VAR_0, (uint8_t *)bdrv_get_device_name(VAR_1->bmds->bs), VAR_2);



    





    if (flags & BLK_MIG_FLAG_ZERO_BLOCK) {

        qemu_fflush(VAR_0);

        return;

    }



    qemu_put_buffer(VAR_0, VAR_1->buf, BLOCK_SIZE);

}

static void FUNC_0(QEMUFile *VAR_0, BlkMigBlock * VAR_1)
{ int VAR_2; uint64_t flags = BLK_MIG_FLAG_DEVICE_BLOCK; if (block_mig_state.zero_blocks &&
buffer_is_zero(VAR_1->buf, BLOCK_SIZE)) { flags |= BLK_MIG_FLAG_ZERO_BLOCK; } qemu_put_be64(VAR_0, (VAR_1->sector << BDRV_SECTOR_BITS)
| flags); VAR_2 = strlen(bdrv_get_device_name(VAR_1->bmds->bs)); qemu_put_byte(VAR_0, VAR_2); qemu_put_buffer(VAR_0, (uint8_t *)bdrv_get_device_name(VAR_1->bmds->bs), VAR_2); if (flags & BLK_MIG_FLAG_ZERO_BLOCK) { qemu_fflush(VAR_0); return; } qemu_put_buffer(VAR_0, VAR_1->buf, BLOCK_SIZE); }