int qemu_savevm_state(QEMUFile *f)

{

    int saved_vm_running;

    int ret;



    saved_vm_running = vm_running;

    vm_stop(0);



    ret = qemu_savevm_state_begin(f);

    if (ret < 0)

        goto out;



    do {

        ret = qemu_savevm_state_iterate(f);

        if (ret < 0)

            goto out;

    } while (ret == 0);



    ret = qemu_savevm_state_complete(f);



out:

    if (saved_vm_running)

        vm_start();

    return ret;

}

int qemu_savevm_state(QEMUFile *f)

{

    int saved_vm_running;

    int ret;



    saved_vm_running = vm_running;

    vm_stop(0);



    ret = qemu_savevm_state_begin(f);

    if (ret < 0)

        goto out;



    do {

        ret = qemu_savevm_state_iterate(f);

        if (ret < 0)

            goto out;

    } while (ret == 0);



    ret = qemu_savevm_state_complete(f);



out:

    if (saved_vm_running)

        vm_start();

    return ret;

}

int FUNC_0(QEMUFile *VAR_0)

{

    int VAR_1;

    int VAR_2;



    VAR_1 = vm_running;

    vm_stop(0);



    VAR_2 = qemu_savevm_state_begin(VAR_0);

    if (VAR_2 < 0)

        goto out;



    do {

        VAR_2 = qemu_savevm_state_iterate(VAR_0);

        if (VAR_2 < 0)

            goto out;

    } while (VAR_2 == 0);



    VAR_2 = qemu_savevm_state_complete(VAR_0);



out:

    if (VAR_1)

        vm_start();

    return VAR_2;

}

int FUNC_0(QEMUFile *VAR_0)
{ int VAR_1; int VAR_2; VAR_1 = vm_running; vm_stop(0); VAR_2 = qemu_savevm_state_begin(VAR_0); if (VAR_2 < 0)
goto out; do { VAR_2 = qemu_savevm_state_iterate(VAR_0); if (VAR_2 < 0)
goto out; } while (VAR_2 == 0); VAR_2 = qemu_savevm_state_complete(VAR_0); out:
if (VAR_1)
vm_start(); return VAR_2; }