mirror of
https://github.com/mii443/qemu.git
synced 2025-08-26 00:49:39 +00:00
throttle: introduce enum ThrottleDirection
Use enum ThrottleDirection instead of number index. Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20230728022006.1098509-2-pizhenwei@bytedance.com> Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
This commit is contained in:
committed by
Hanna Czenczek
parent
f5fe7c17ac
commit
8ba02c24ea
@ -99,13 +99,18 @@ typedef struct ThrottleState {
|
||||
int64_t previous_leak; /* timestamp of the last leak done */
|
||||
} ThrottleState;
|
||||
|
||||
typedef enum {
|
||||
THROTTLE_READ = 0,
|
||||
THROTTLE_WRITE,
|
||||
THROTTLE_MAX
|
||||
} ThrottleDirection;
|
||||
|
||||
typedef struct ThrottleTimers {
|
||||
QEMUTimer *timers[2]; /* timers used to do the throttling */
|
||||
QEMUTimer *timers[THROTTLE_MAX]; /* timers used to do the throttling */
|
||||
QEMUClockType clock_type; /* the clock used */
|
||||
|
||||
/* Callbacks */
|
||||
QEMUTimerCB *read_timer_cb;
|
||||
QEMUTimerCB *write_timer_cb;
|
||||
QEMUTimerCB *timer_cb[THROTTLE_MAX];
|
||||
void *timer_opaque;
|
||||
} ThrottleTimers;
|
||||
|
||||
|
Reference in New Issue
Block a user