void qmp_xen_save_devices_state(const char *filename, Error **errp)

{

    QEMUFile *f;

    QIOChannelFile *ioc;

    int saved_vm_running;

    int ret;



    saved_vm_running = runstate_is_running();

    vm_stop(RUN_STATE_SAVE_VM);

    global_state_store_running();



    ioc = qio_channel_file_new_path(filename, O_WRONLY | O_CREAT, 0660, errp);

    if (!ioc) {

        goto the_end;

    }

    qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state");

    f = qemu_fopen_channel_output(QIO_CHANNEL(ioc));

    ret = qemu_save_device_state(f);

    qemu_fclose(f);

    if (ret < 0) {

        error_setg(errp, QERR_IO_ERROR);

    }



 the_end:

    if (saved_vm_running) {

        vm_start();

    }

}

void qmp_xen_save_devices_state(const char *filename, Error **errp)

{

    QEMUFile *f;

    QIOChannelFile *ioc;

    int saved_vm_running;

    int ret;



    saved_vm_running = runstate_is_running();

    vm_stop(RUN_STATE_SAVE_VM);

    global_state_store_running();



    ioc = qio_channel_file_new_path(filename, O_WRONLY | O_CREAT, 0660, errp);

    if (!ioc) {

        goto the_end;

    }

    qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state");

    f = qemu_fopen_channel_output(QIO_CHANNEL(ioc));

    ret = qemu_save_device_state(f);

    qemu_fclose(f);

    if (ret < 0) {

        error_setg(errp, QERR_IO_ERROR);

    }



 the_end:

    if (saved_vm_running) {

        vm_start();

    }

}

void qmp_xen_save_devices_state(const char *filename, Error **errp)
void FUNC_0(const char *VAR_0, Error **VAR_1)

{

    QEMUFile *f;

    QIOChannelFile *ioc;

    int VAR_2;

    int VAR_3;



    VAR_2 = runstate_is_running();

    vm_stop(RUN_STATE_SAVE_VM);

    global_state_store_running();



    ioc = qio_channel_file_new_path(VAR_0, O_WRONLY | O_CREAT, 0660, VAR_1);

    if (!ioc) {

        goto the_end;

    }

    qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state");

    f = qemu_fopen_channel_output(QIO_CHANNEL(ioc));

    VAR_3 = qemu_save_device_state(f);

    qemu_fclose(f);

    if (VAR_3 < 0) {

        error_setg(VAR_1, QERR_IO_ERROR);

    }



 the_end:

    if (VAR_2) {

        vm_start();

    }

}

void FUNC_0(const char *VAR_0, Error **VAR_1)
{ QEMUFile *f; QIOChannelFile *ioc; int VAR_2; int VAR_3; VAR_2 = runstate_is_running(); vm_stop(RUN_STATE_SAVE_VM); global_state_store_running(); ioc = qio_channel_file_new_path(VAR_0, O_WRONLY | O_CREAT, 0660, VAR_1); if (!ioc) { goto the_end; } qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state"); f = qemu_fopen_channel_output(QIO_CHANNEL(ioc)); VAR_3 = qemu_save_device_state(f); qemu_fclose(f); if (VAR_3 < 0) { error_setg(VAR_1, QERR_IO_ERROR); } the_end:
if (VAR_2) { vm_start(); } }