mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
fe10ab540b
commit
bc72ad6754
121 changed files with 678 additions and 678 deletions
|
@ -129,8 +129,8 @@ static void check_rate_limit(void *opaque)
|
|||
|
||||
vrng->quota_remaining = vrng->conf.max_bytes;
|
||||
virtio_rng_process(vrng);
|
||||
qemu_mod_timer(vrng->rate_limit_timer,
|
||||
qemu_get_clock_ms(vm_clock) + vrng->conf.period_ms);
|
||||
timer_mod(vrng->rate_limit_timer,
|
||||
qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + vrng->conf.period_ms);
|
||||
}
|
||||
|
||||
static int virtio_rng_device_init(VirtIODevice *vdev)
|
||||
|
@ -172,11 +172,11 @@ static int virtio_rng_device_init(VirtIODevice *vdev)
|
|||
assert(vrng->conf.max_bytes <= INT64_MAX);
|
||||
vrng->quota_remaining = vrng->conf.max_bytes;
|
||||
|
||||
vrng->rate_limit_timer = qemu_new_timer_ms(vm_clock,
|
||||
vrng->rate_limit_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL,
|
||||
check_rate_limit, vrng);
|
||||
|
||||
qemu_mod_timer(vrng->rate_limit_timer,
|
||||
qemu_get_clock_ms(vm_clock) + vrng->conf.period_ms);
|
||||
timer_mod(vrng->rate_limit_timer,
|
||||
qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + vrng->conf.period_ms);
|
||||
|
||||
register_savevm(qdev, "virtio-rng", -1, 1, virtio_rng_save,
|
||||
virtio_rng_load, vrng);
|
||||
|
@ -189,8 +189,8 @@ static int virtio_rng_device_exit(DeviceState *qdev)
|
|||
VirtIORNG *vrng = VIRTIO_RNG(qdev);
|
||||
VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
|
||||
|
||||
qemu_del_timer(vrng->rate_limit_timer);
|
||||
qemu_free_timer(vrng->rate_limit_timer);
|
||||
timer_del(vrng->rate_limit_timer);
|
||||
timer_free(vrng->rate_limit_timer);
|
||||
unregister_savevm(qdev, "virtio-rng", vrng);
|
||||
virtio_cleanup(vdev);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue