Lines Matching +full:qemu +full:- +full:kvm
2 * TOD (Time Of Day) clock - KVM implementation
8 * See the COPYING file in the top-level directory.
11 #include "qemu/osdep.h"
13 #include "qemu/module.h"
16 #include "target/s390x/kvm/pv.h"
17 #include "kvm/kvm_s390x.h"
23 r = kvm_s390_get_clock_ext(&tod->high, &tod->low); in kvm_s390_get_tod_raw()
24 if (r == -ENXIO) { in kvm_s390_get_tod_raw()
25 r = kvm_s390_get_clock(&tod->high, &tod->low); in kvm_s390_get_tod_raw()
28 error_setg(errp, "Unable to get KVM guest TOD clock: %s", in kvm_s390_get_tod_raw()
29 strerror(-r)); in kvm_s390_get_tod_raw()
35 if (td->stopped) { in kvm_s390_tod_get()
36 *tod = td->base; in kvm_s390_tod_get()
47 r = kvm_s390_set_clock_ext(tod->high, tod->low); in kvm_s390_set_tod_raw()
48 if (r == -ENXIO) { in kvm_s390_set_tod_raw()
49 r = kvm_s390_set_clock(tod->high, tod->low); in kvm_s390_set_tod_raw()
52 error_setg(errp, "Unable to set KVM guest TOD clock: %s", in kvm_s390_set_tod_raw()
53 strerror(-r)); in kvm_s390_set_tod_raw()
62 * Somebody (e.g. migration) set the TOD. We'll store it into KVM to in kvm_s390_tod_set()
75 td->stopped = false; in kvm_s390_tod_set()
77 td->stopped = true; in kvm_s390_tod_set()
78 td->base = *tod; in kvm_s390_tod_set()
96 if (running && td->stopped) { in kvm_s390_tod_vm_state_change()
97 /* Set the old TOD when running the VM - start the TOD clock. */ in kvm_s390_tod_vm_state_change()
98 kvm_s390_set_tod_raw(&td->base, &local_err); in kvm_s390_tod_vm_state_change()
103 td->stopped = false; in kvm_s390_tod_vm_state_change()
104 } else if (!running && !td->stopped) { in kvm_s390_tod_vm_state_change()
105 /* Store the TOD when stopping the VM - stop the TOD clock. */ in kvm_s390_tod_vm_state_change()
106 kvm_s390_get_tod_raw(&td->base, &local_err); in kvm_s390_tod_vm_state_change()
111 td->stopped = true; in kvm_s390_tod_vm_state_change()
122 tdc->parent_realize(dev, &local_err); in kvm_s390_tod_realize()
141 &tdc->parent_realize); in kvm_s390_tod_class_init()
142 tdc->get = kvm_s390_tod_get; in kvm_s390_tod_class_init()
143 tdc->set = kvm_s390_tod_set; in kvm_s390_tod_class_init()
151 * The TOD is initially running (value stored in KVM). Avoid needless in kvm_s390_tod_init()
156 td->stopped = false; in kvm_s390_tod_init()