[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/7] hw/virtio/virtio-balloon: Rename timer field including '
From: |
David Hildenbrand |
Subject: |
Re: [PATCH 4/7] hw/virtio/virtio-balloon: Rename timer field including 'ms' unit |
Date: |
Tue, 16 Jun 2020 09:57:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 16.06.20 09:51, Philippe Mathieu-Daudé wrote:
> To make code review easier, append the timer unit (milli-seconds)
> to its variable name.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/hw/virtio/virtio-balloon.h | 2 +-
> hw/virtio/virtio-balloon.c | 14 ++++++++------
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/include/hw/virtio/virtio-balloon.h
> b/include/hw/virtio/virtio-balloon.h
> index d49fef00ce..8a85fb1b88 100644
> --- a/include/hw/virtio/virtio-balloon.h
> +++ b/include/hw/virtio/virtio-balloon.h
> @@ -50,7 +50,7 @@ typedef struct VirtIOBalloon {
> uint64_t stats[VIRTIO_BALLOON_S_NR];
> VirtQueueElement *stats_vq_elem;
> size_t stats_vq_offset;
> - QEMUTimer *stats_timer;
> + QEMUTimer *stats_timer_ms;
> IOThread *iothread;
> QEMUBH *free_page_bh;
> /*
> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
> index 10507b2a43..ad67cd53e4 100644
> --- a/hw/virtio/virtio-balloon.c
> +++ b/hw/virtio/virtio-balloon.c
> @@ -197,16 +197,17 @@ static bool balloon_stats_enabled(const VirtIOBalloon
> *s)
> static void balloon_stats_destroy_timer(VirtIOBalloon *s)
> {
> if (balloon_stats_enabled(s)) {
> - timer_del(s->stats_timer);
> - timer_free(s->stats_timer);
> - s->stats_timer = NULL;
> + timer_del(s->stats_timer_ms);
> + timer_free(s->stats_timer_ms);
> + s->stats_timer_ms = NULL;
> s->stats_poll_interval = 0;
> }
> }
>
> static void balloon_stats_change_timer(VirtIOBalloon *s, int64_t secs)
> {
> - timer_mod(s->stats_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + secs *
> 1000);
> + timer_mod(s->stats_timer_ms,
> + qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + secs * 1000);
> }
>
> static void balloon_stats_poll_cb(void *opaque)
> @@ -315,8 +316,9 @@ static void balloon_stats_set_poll_interval(Object *obj,
> Visitor *v,
> }
>
> /* create a new timer */
> - g_assert(s->stats_timer == NULL);
> - s->stats_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, balloon_stats_poll_cb,
> s);
> + g_assert(s->stats_timer_ms == NULL);
> + s->stats_timer_ms = timer_new_ms(QEMU_CLOCK_VIRTUAL,
> + balloon_stats_poll_cb, s);
> s->stats_poll_interval = value;
> balloon_stats_change_timer(s, 0);
> }
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
- [PATCH 0/7] misc: Reduce QEMUTimer pressure by using lower precision when possible, Philippe Mathieu-Daudé, 2020/06/16
- [PATCH 1/7] qemu-common: Briefly document qemu_timedate_diff() unit, Philippe Mathieu-Daudé, 2020/06/16
- [PATCH 2/7] block/qcow2: Document cache_clean_interval field holds seconds, Philippe Mathieu-Daudé, 2020/06/16
- [PATCH 3/7] block/curl: Reduce timer precision to milli-second, Philippe Mathieu-Daudé, 2020/06/16
- [PATCH 4/7] hw/virtio/virtio-balloon: Rename timer field including 'ms' unit, Philippe Mathieu-Daudé, 2020/06/16
- Re: [PATCH 4/7] hw/virtio/virtio-balloon: Rename timer field including 'ms' unit,
David Hildenbrand <=
- [PATCH 5/7] hw/rtc/m48t59: Reduce timer precision to milli-second, Philippe Mathieu-Daudé, 2020/06/16
- [PATCH 6/7] hw/ipmi/ipmi_bmc_extern: Reduce timer precision to milli-second, Philippe Mathieu-Daudé, 2020/06/16
- [PATCH 7/7] hw/watchdog/wdt_aspeed: Reduce timer precision to micro-second, Philippe Mathieu-Daudé, 2020/06/16
Re: [PATCH 0/7] misc: Reduce QEMUTimer pressure by using lower precision when possible, Paolo Bonzini, 2020/06/18