static int migration_put_buffer(void *opaque, const uint8_t *buf,

                               int64_t pos, int size)

{

    MigrationState *s = opaque;

    int ret;



    DPRINTF("putting %d bytes at %" PRId64 "\n", size, pos);



    if (size <= 0) {

        return size;

    }



    qemu_put_buffer(s->migration_file, buf, size);

    ret = qemu_file_get_error(s->migration_file);

    if (ret) {

        return ret;

    }



    s->bytes_xfer += size;

    return size;

}

static int migration_put_buffer(void *opaque, const uint8_t *buf,

                               int64_t pos, int size)

{

    MigrationState *s = opaque;

    int ret;



    DPRINTF("putting %d bytes at %" PRId64 "\n", size, pos);



    if (size <= 0) {

        return size;

    }



    qemu_put_buffer(s->migration_file, buf, size);

    ret = qemu_file_get_error(s->migration_file);

    if (ret) {

        return ret;

    }



    s->bytes_xfer += size;

    return size;

}

static int FUNC_0(void *VAR_0, const uint8_t *VAR_1,

                               int64_t VAR_2, int VAR_3)

{

    MigrationState *s = VAR_0;

    int VAR_4;



    DPRINTF("putting %d bytes at %" PRId64 "\n", VAR_3, VAR_2);



    if (VAR_3 <= 0) {

        return VAR_3;

    }



    qemu_put_buffer(s->migration_file, VAR_1, VAR_3);

    VAR_4 = qemu_file_get_error(s->migration_file);

    if (VAR_4) {

        return VAR_4;

    }



    s->bytes_xfer += VAR_3;

    return VAR_3;

}

static int FUNC_0(void *VAR_0, const uint8_t *VAR_1,
int64_t VAR_2, int VAR_3)
{ MigrationState *s = VAR_0; int VAR_4; DPRINTF("putting %d bytes at %" PRId64 "\n", VAR_3, VAR_2); if (VAR_3 <= 0) { return VAR_3; } qemu_put_buffer(s->migration_file, VAR_1, VAR_3); VAR_4 = qemu_file_get_error(s->migration_file); if (VAR_4) { return VAR_4; } s->bytes_xfer += VAR_3; return VAR_3; }