int vmstate_register(int instance_id, const VMStateDescription *vmsd,

                     void *opaque)

{

    SaveStateEntry *se;



    se = qemu_malloc(sizeof(SaveStateEntry));

    pstrcpy(se->idstr, sizeof(se->idstr), vmsd->name);

    se->version_id = vmsd->version_id;

    se->section_id = global_section_id++;

    se->save_live_state = NULL;

    se->save_state = NULL;

    se->load_state = NULL;

    se->opaque = opaque;

    se->vmsd = vmsd;



    if (instance_id == -1) {

        se->instance_id = calculate_new_instance_id(vmsd->name);

    } else {

        se->instance_id = instance_id;

    }

    /* add at the end of list */

    TAILQ_INSERT_TAIL(&savevm_handlers, se, entry);

    return 0;

}

int vmstate_register(int instance_id, const VMStateDescription *vmsd,

                     void *opaque)

{

    SaveStateEntry *se;



    se = qemu_malloc(sizeof(SaveStateEntry));

    pstrcpy(se->idstr, sizeof(se->idstr), vmsd->name);

    se->version_id = vmsd->version_id;

    se->section_id = global_section_id++;

    se->save_live_state = NULL;

    se->save_state = NULL;

    se->load_state = NULL;

    se->opaque = opaque;

    se->vmsd = vmsd;



    if (instance_id == -1) {

        se->instance_id = calculate_new_instance_id(vmsd->name);

    } else {

        se->instance_id = instance_id;

    }

    

    TAILQ_INSERT_TAIL(&savevm_handlers, se, entry);

    return 0;

}

int FUNC_0(int VAR_0, const VMStateDescription *VAR_1,

                     void *VAR_2)

{

    SaveStateEntry *se;



    se = qemu_malloc(sizeof(SaveStateEntry));

    pstrcpy(se->idstr, sizeof(se->idstr), VAR_1->name);

    se->version_id = VAR_1->version_id;

    se->section_id = global_section_id++;

    se->save_live_state = NULL;

    se->save_state = NULL;

    se->load_state = NULL;

    se->VAR_2 = VAR_2;

    se->VAR_1 = VAR_1;



    if (VAR_0 == -1) {

        se->VAR_0 = calculate_new_instance_id(VAR_1->name);

    } else {

        se->VAR_0 = VAR_0;

    }

    

    TAILQ_INSERT_TAIL(&savevm_handlers, se, entry);

    return 0;

}

int FUNC_0(int VAR_0, const VMStateDescription *VAR_1,
void *VAR_2)
{ SaveStateEntry *se; se = qemu_malloc(sizeof(SaveStateEntry)); pstrcpy(se->idstr, sizeof(se->idstr), VAR_1->name); se->version_id = VAR_1->version_id; se->section_id = global_section_id++; se->save_live_state = NULL; se->save_state = NULL; se->load_state = NULL; se->VAR_2 = VAR_2; se->VAR_1 = VAR_1; if (VAR_0 == -1) { se->VAR_0 = calculate_new_instance_id(VAR_1->name); } else { se->VAR_0 = VAR_0; } TAILQ_INSERT_TAIL(&savevm_handlers, se, entry); return 0; }