[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/5] monitor: rename QDict *data->qdict
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v2 3/5] monitor: rename QDict *data->qdict |
Date: |
Thu, 17 Sep 2015 18:08:48 +0200 |
From: Marc-André Lureau <address@hidden>
As suggested by Markus Armbruster, this is a bit more specific for the
event qdict than 'data'.
Signed-off-by: Marc-André Lureau <address@hidden>
---
monitor.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/monitor.c b/monitor.c
index e78ecc2..2f8af5b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -178,13 +178,13 @@ typedef struct {
QAPIEvent event; /* Event being tracked */
int64_t last; /* QEMU_CLOCK_REALTIME value at last emission */
QEMUTimer *timer; /* Timer for handling delayed events */
- QObject *data; /* Event pending delayed dispatch */
+ QObject *qdict; /* Event pending delayed dispatch */
} MonitorQAPIEventPending;
typedef struct MonitorQAPIEventState MonitorQAPIEventState;
typedef bool (*MonitorQAPIEventDelay)(MonitorQAPIEventState *evstate,
- QDict *data);
+ QDict *qdict);
/*
* To prevent flooding clients, events can be throttled. The
* throttling is calculated globally, rather than per-Monitor
@@ -472,14 +472,14 @@ static void monitor_qapi_event_emit(QAPIEvent event,
QObject *data)
* Return 'false' if the event is not delayed and can be emitted now.
*/
static bool
-monitor_qapi_event_delay(MonitorQAPIEventState *evstate, QDict *data)
+monitor_qapi_event_delay(MonitorQAPIEventState *evstate, QDict *qdict)
{
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
MonitorQAPIEventPending *p = evstate->delay_data;
int64_t delta = now - p->last;
trace_monitor_protocol_event_delay(p->event,
- data,
+ qdict,
evstate->rate,
p->last,
now);
@@ -490,19 +490,19 @@ monitor_qapi_event_delay(MonitorQAPIEventState *evstate,
QDict *data)
return false;
}
- if (p->data || delta < evstate->rate) {
+ if (p->qdict || delta < evstate->rate) {
/* If there's an existing event pending, replace
* it with the new event, otherwise schedule a
* timer for delayed emission
*/
- if (p->data) {
- qobject_decref(p->data);
+ if (p->qdict) {
+ qobject_decref(p->qdict);
} else {
int64_t then = p->last + evstate->rate;
timer_mod_ns(p->timer, then);
}
- p->data = QOBJECT(data);
- qobject_incref(p->data);
+ p->qdict = QOBJECT(qdict);
+ qobject_incref(p->qdict);
return true;
}
@@ -515,19 +515,19 @@ monitor_qapi_event_delay(MonitorQAPIEventState *evstate,
QDict *data)
* applying any rate limiting if required.
*/
static void
-monitor_qapi_event_queue(QAPIEvent event, QDict *data, Error **errp)
+monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, Error **errp)
{
MonitorQAPIEventState *evstate;
assert(event < QAPI_EVENT_MAX);
evstate = &monitor_qapi_event_state[event];
- trace_monitor_protocol_event_queue(event, data);
+ trace_monitor_protocol_event_queue(event, qdict);
qemu_mutex_lock(&monitor_lock);
if (!evstate->delay ||
- !evstate->delay(evstate, data)) {
- monitor_qapi_event_emit(event, QOBJECT(data));
+ !evstate->delay(evstate, qdict)) {
+ monitor_qapi_event_emit(event, QOBJECT(qdict));
}
qemu_mutex_unlock(&monitor_lock);
@@ -543,14 +543,14 @@ static void monitor_qapi_event_handler(void *opaque)
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
trace_monitor_protocol_event_handler(p->event,
- p->data,
+ p->qdict,
p->last,
now);
qemu_mutex_lock(&monitor_lock);
- if (p->data) {
- monitor_qapi_event_emit(p->event, p->data);
- qobject_decref(p->data);
- p->data = NULL;
+ if (p->qdict) {
+ monitor_qapi_event_emit(p->event, p->qdict);
+ qobject_decref(p->qdict);
+ p->qdict = NULL;
}
p->last = now;
qemu_mutex_unlock(&monitor_lock);
--
2.4.3
- [Qemu-devel] [PATCH v2 0/5] monitor: throttle VSERPORT_CHANGED by "id", marcandre . lureau, 2015/09/17
- [Qemu-devel] [PATCH v2 1/5] monitor: split MonitorQAPIEventState, marcandre . lureau, 2015/09/17
- [Qemu-devel] [PATCH v2 2/5] monitor: introduce MonitorQAPIEventDelay callback, marcandre . lureau, 2015/09/17
- [Qemu-devel] [PATCH v2 4/5] monitor: throttle QAPI_EVENT_VSERPORT_CHANGE by "id", marcandre . lureau, 2015/09/17
- [Qemu-devel] [PATCH v2 3/5] monitor: rename QDict *data->qdict,
marcandre . lureau <=
- [Qemu-devel] [PATCH v2 5/5] monitor: remove old entries from event hash table, marcandre . lureau, 2015/09/17
- Re: [Qemu-devel] [PATCH v2 0/5] monitor: throttle VSERPORT_CHANGED by "id", Marc-André Lureau, 2015/09/23