qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [PATCH 1/5] throttle: introduce enum ThrottleTimerType


From: zhenwei pi
Subject: Re: Re: [PATCH 1/5] throttle: introduce enum ThrottleTimerType
Date: Tue, 27 Jun 2023 13:06:29 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0



On 6/27/23 05:24, Alberto Garcia wrote:
On Sun 25 Jun 2023 04:56:27 PM +08, zhenwei pi wrote:
Use enum ThrottleTimerType instead of number index.

+typedef enum {
+    THROTTLE_TIMER_READ = 0,
+    THROTTLE_TIMER_WRITE,
+    THROTTLE_TIMER_MAX
+} ThrottleTimerType;

If you're doing this I suppose you could also change 'bool is_write'
with something like 'ThrottleTimerType timer', i.e

static bool throttle_compute_timer(ThrottleState *ts,
                                    ThrottleTimerType timer,
                                    int64_t now,
                                    int64_t *next_timestamp)

Berto

Hi,

Right, it's in my plan. But I prefer to do this in a followup patch after this series applies. Because this API leads changes from other subsystems.

By the way, I prepare to rename 'THROTTLE_TIMER_READ' to 'THROTTLE_READ' in next version.

Do you have any suggestion?

--
zhenwei pi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]