static void kvmclock_pre_save(void *opaque)

{

    KVMClockState *s = opaque;

    struct kvm_clock_data data;

    int ret;



    if (s->clock_valid) {

        return;

    }

    ret = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &data);

    if (ret < 0) {

        fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(ret));

        data.clock = 0;

    }

    s->clock = data.clock;

    /*

     * If the VM is stopped, declare the clock state valid to avoid re-reading

     * it on next vmsave (which would return a different value). Will be reset

     * when the VM is continued.

     */

    s->clock_valid = !runstate_is_running();

}

static void kvmclock_pre_save(void *opaque)

{

    KVMClockState *s = opaque;

    struct kvm_clock_data data;

    int ret;



    if (s->clock_valid) {

        return;

    }

    ret = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &data);

    if (ret < 0) {

        fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(ret));

        data.clock = 0;

    }

    s->clock = data.clock;

    









    s->clock_valid = !runstate_is_running();

}

static void kvmclock_pre_save(void *opaque)     KVMClockState *s = opaque;     struct kvm_clock_data data;     int ret;     if (s->clock_valid) {     ret = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &data);     if (ret < 0) {         fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(ret));         data.clock = 0;     s->clock = data.clock;     s->clock_valid = !runstate_is_running();     KVMClockState *s = opaque;     struct kvm_clock_data data;
static void FUNC_0(void *VAR_0)

{

    KVMClockState *s = VAR_0;

    struct kvm_clock_data VAR_1;

    int VAR_2;



    if (s->clock_valid) {

        return;

    }

    VAR_2 = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &VAR_1);

    if (VAR_2 < 0) {

        fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(VAR_2));

        VAR_1.clock = 0;

    }

    s->clock = VAR_1.clock;

    









    s->clock_valid = !runstate_is_running();

}

static void FUNC_0(void *VAR_0)
{ KVMClockState *s = VAR_0; struct kvm_clock_data VAR_1; int VAR_2; if (s->clock_valid) { return; } VAR_2 = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &VAR_1); if (VAR_2 < 0) { fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(VAR_2)); VAR_1.clock = 0; } s->clock = VAR_1.clock; s->clock_valid = !runstate_is_running(); }