mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -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
|
@ -162,14 +162,14 @@ static void virtio_net_set_status(struct VirtIODevice *vdev, uint8_t status)
|
|||
|
||||
if (virtio_net_started(n, queue_status) && !n->vhost_started) {
|
||||
if (q->tx_timer) {
|
||||
qemu_mod_timer(q->tx_timer,
|
||||
qemu_get_clock_ns(vm_clock) + n->tx_timeout);
|
||||
timer_mod(q->tx_timer,
|
||||
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + n->tx_timeout);
|
||||
} else {
|
||||
qemu_bh_schedule(q->tx_bh);
|
||||
}
|
||||
} else {
|
||||
if (q->tx_timer) {
|
||||
qemu_del_timer(q->tx_timer);
|
||||
timer_del(q->tx_timer);
|
||||
} else {
|
||||
qemu_bh_cancel(q->tx_bh);
|
||||
}
|
||||
|
@ -1131,12 +1131,12 @@ static void virtio_net_handle_tx_timer(VirtIODevice *vdev, VirtQueue *vq)
|
|||
|
||||
if (q->tx_waiting) {
|
||||
virtio_queue_set_notification(vq, 1);
|
||||
qemu_del_timer(q->tx_timer);
|
||||
timer_del(q->tx_timer);
|
||||
q->tx_waiting = 0;
|
||||
virtio_net_flush_tx(q);
|
||||
} else {
|
||||
qemu_mod_timer(q->tx_timer,
|
||||
qemu_get_clock_ns(vm_clock) + n->tx_timeout);
|
||||
timer_mod(q->tx_timer,
|
||||
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + n->tx_timeout);
|
||||
q->tx_waiting = 1;
|
||||
virtio_queue_set_notification(vq, 0);
|
||||
}
|
||||
|
@ -1233,7 +1233,7 @@ static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue)
|
|||
if (n->vqs[i].tx_timer) {
|
||||
n->vqs[i].tx_vq =
|
||||
virtio_add_queue(vdev, 256, virtio_net_handle_tx_timer);
|
||||
n->vqs[i].tx_timer = qemu_new_timer_ns(vm_clock,
|
||||
n->vqs[i].tx_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
|
||||
virtio_net_tx_timer,
|
||||
&n->vqs[i]);
|
||||
} else {
|
||||
|
@ -1513,7 +1513,7 @@ static int virtio_net_device_init(VirtIODevice *vdev)
|
|||
if (n->net_conf.tx && !strcmp(n->net_conf.tx, "timer")) {
|
||||
n->vqs[0].tx_vq = virtio_add_queue(vdev, 256,
|
||||
virtio_net_handle_tx_timer);
|
||||
n->vqs[0].tx_timer = qemu_new_timer_ns(vm_clock, virtio_net_tx_timer,
|
||||
n->vqs[0].tx_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, virtio_net_tx_timer,
|
||||
&n->vqs[0]);
|
||||
} else {
|
||||
n->vqs[0].tx_vq = virtio_add_queue(vdev, 256,
|
||||
|
@ -1598,8 +1598,8 @@ static int virtio_net_device_exit(DeviceState *qdev)
|
|||
qemu_purge_queued_packets(nc);
|
||||
|
||||
if (q->tx_timer) {
|
||||
qemu_del_timer(q->tx_timer);
|
||||
qemu_free_timer(q->tx_timer);
|
||||
timer_del(q->tx_timer);
|
||||
timer_free(q->tx_timer);
|
||||
} else {
|
||||
qemu_bh_delete(q->tx_bh);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue