static void migrate_fd_cleanup(MigrationState *s)

{

    int ret = 0;



    if (s->file) {

        DPRINTF("closing file\n");

        ret = qemu_fclose(s->file);

        s->file = NULL;

    }



    assert(s->fd == -1);

    if (ret < 0 && s->state == MIG_STATE_ACTIVE) {

        s->state = MIG_STATE_ERROR;

    }



    if (s->state != MIG_STATE_ACTIVE) {

        qemu_savevm_state_cancel();

    }

}

static void migrate_fd_cleanup(MigrationState *s)

{

    int ret = 0;



    if (s->file) {

        DPRINTF("closing file\n");

        ret = qemu_fclose(s->file);

        s->file = NULL;

    }



    assert(s->fd == -1);

    if (ret < 0 && s->state == MIG_STATE_ACTIVE) {

        s->state = MIG_STATE_ERROR;

    }



    if (s->state != MIG_STATE_ACTIVE) {

        qemu_savevm_state_cancel();

    }

}

static void FUNC_0(MigrationState *VAR_0)

{

    int VAR_1 = 0;



    if (VAR_0->file) {

        DPRINTF("closing file\n");

        VAR_1 = qemu_fclose(VAR_0->file);

        VAR_0->file = NULL;

    }



    assert(VAR_0->fd == -1);

    if (VAR_1 < 0 && VAR_0->state == MIG_STATE_ACTIVE) {

        VAR_0->state = MIG_STATE_ERROR;

    }



    if (VAR_0->state != MIG_STATE_ACTIVE) {

        qemu_savevm_state_cancel();

    }

}

static void FUNC_0(MigrationState *VAR_0)
{ int VAR_1 = 0; if (VAR_0->file) { DPRINTF("closing file\n"); VAR_1 = qemu_fclose(VAR_0->file); VAR_0->file = NULL; } assert(VAR_0->fd == -1); if (VAR_1 < 0 && VAR_0->state == MIG_STATE_ACTIVE) { VAR_0->state = MIG_STATE_ERROR; } if (VAR_0->state != MIG_STATE_ACTIVE) { qemu_savevm_state_cancel(); } }