From patchwork Mon Oct 21 02:16:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 285158 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 684522C012B for ; Mon, 21 Oct 2013 21:17:18 +1100 (EST) Received: from localhost ([::1]:39188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYCXz-00055x-LW for incoming@patchwork.ozlabs.org; Mon, 21 Oct 2013 06:17:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYCXO-0004tj-Gn for qemu-devel@nongnu.org; Mon, 21 Oct 2013 06:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYCXA-0006wY-H7 for qemu-devel@nongnu.org; Mon, 21 Oct 2013 06:16:38 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:55450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYCX9-0006vy-NM for qemu-devel@nongnu.org; Mon, 21 Oct 2013 06:16:24 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Oct 2013 15:46:22 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp08.in.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 21 Oct 2013 15:46:20 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 432B9E0056 for ; Mon, 21 Oct 2013 15:47:50 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9LAJCxI38207556 for ; Mon, 21 Oct 2013 15:49:12 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r9LAGIMO016094 for ; Mon, 21 Oct 2013 15:46:18 +0530 Received: from RH64wenchao ([9.181.129.59]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r9LAGBDg015445; Mon, 21 Oct 2013 15:46:16 +0530 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Mon, 21 Oct 2013 10:16:02 +0800 Message-Id: <1382321765-29052-4-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1382321765-29052-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1382321765-29052-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13102110-2000-0000-0000-00000E323DA1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.8 Cc: kwolf@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, Wenchao Xia Subject: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The define will be moved to qapi-schema.json later, so rename the prefix to match its naming style. Also fixed code style error reported in spice-core.c. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- balloon.c | 2 +- block.c | 4 +- block/qcow2-refcount.c | 2 +- blockdev.c | 4 +- blockjob.c | 5 ++- cpus.c | 2 +- hw/acpi/core.c | 2 +- hw/core/qdev.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/net/virtio-net.c | 2 +- hw/watchdog/watchdog.c | 2 +- include/monitor/monitor.h | 58 +++++++++++++++++----------------- monitor.c | 74 ++++++++++++++++++++++---------------------- target-s390x/kvm.c | 2 +- ui/spice-core.c | 8 ++-- ui/vnc.c | 6 ++-- vl.c | 14 ++++---- 17 files changed, 96 insertions(+), 95 deletions(-) diff --git a/balloon.c b/balloon.c index e321f2c..16ea2e1 100644 --- a/balloon.c +++ b/balloon.c @@ -88,7 +88,7 @@ void qemu_balloon_changed(int64_t actual) data = qobject_from_jsonf("{ 'actual': %" PRId64 " }", actual); - monitor_protocol_event(QEVENT_BALLOON_CHANGE, data); + monitor_protocol_event(Q_EVENT_BALLOON_CHANGE, data); qobject_decref(data); } diff --git a/block.c b/block.c index 458a4f8..002405f 100644 --- a/block.c +++ b/block.c @@ -1795,7 +1795,7 @@ static void bdrv_emit_qmp_eject_event(BlockDriverState *bs, bool ejected) data = qobject_from_jsonf("{ 'device': %s, 'tray-open': %i }", bdrv_get_device_name(bs), ejected); - monitor_protocol_event(QEVENT_DEVICE_TRAY_MOVED, data); + monitor_protocol_event(Q_EVENT_DEVICE_TRAY_MOVED, data); qobject_decref(data); } @@ -2926,7 +2926,7 @@ void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, bool is_read, int error) { assert(error >= 0); - bdrv_emit_qmp_error_event(bs, QEVENT_BLOCK_IO_ERROR, action, is_read); + bdrv_emit_qmp_error_event(bs, Q_EVENT_BLOCK_IO_ERROR, action, is_read); if (action == BDRV_ACTION_STOP) { vm_stop(RUN_STATE_IO_ERROR); bdrv_iostatus_set_err(bs, error); diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 1ff43d0..f31faa9 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1787,7 +1787,7 @@ int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset, data = qobject_from_jsonf("{ 'device': %s, 'msg': %s, 'offset': %" PRId64 ", 'size': %" PRId64 " }", bs->device_name, message, offset, size); - monitor_protocol_event(QEVENT_BLOCK_IMAGE_CORRUPTED, data); + monitor_protocol_event(Q_EVENT_BLOCK_IMAGE_CORRUPTED, data); g_free(message); qobject_decref(data); diff --git a/blockdev.c b/blockdev.c index b260477..ed30f3a 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1725,9 +1725,9 @@ static void block_job_cb(void *opaque, int ret) } if (block_job_is_cancelled(bs->job)) { - monitor_protocol_event(QEVENT_BLOCK_JOB_CANCELLED, obj); + monitor_protocol_event(Q_EVENT_BLOCK_JOB_CANCELLED, obj); } else { - monitor_protocol_event(QEVENT_BLOCK_JOB_COMPLETED, obj); + monitor_protocol_event(Q_EVENT_BLOCK_JOB_COMPLETED, obj); } qobject_decref(obj); diff --git a/blockjob.c b/blockjob.c index 9e5fd5c..77940de 100644 --- a/blockjob.c +++ b/blockjob.c @@ -246,7 +246,7 @@ QObject *qobject_from_block_job(BlockJob *job) void block_job_ready(BlockJob *job) { QObject *data = qobject_from_block_job(job); - monitor_protocol_event(QEVENT_BLOCK_JOB_READY, data); + monitor_protocol_event(Q_EVENT_BLOCK_JOB_READY, data); qobject_decref(data); } @@ -272,7 +272,8 @@ BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs, default: abort(); } - bdrv_emit_qmp_error_event(job->bs, QEVENT_BLOCK_JOB_ERROR, action, is_read); + bdrv_emit_qmp_error_event(job->bs, Q_EVENT_BLOCK_JOB_ERROR, + action, is_read); if (action == BDRV_ACTION_STOP) { block_job_pause(job); block_job_iostatus_set_err(job, error); diff --git a/cpus.c b/cpus.c index 398229e..1fe67d3 100644 --- a/cpus.c +++ b/cpus.c @@ -530,7 +530,7 @@ static int do_vm_stop(RunState state) pause_all_vcpus(); runstate_set(state); vm_state_notify(0, state); - monitor_protocol_event(QEVENT_STOP, NULL); + monitor_protocol_event(Q_EVENT_STOP, NULL); } bdrv_drain_all(); diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 7138139..fbb8efb 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -511,7 +511,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val) break; default: if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */ - monitor_protocol_event(QEVENT_SUSPEND_DISK, NULL); + monitor_protocol_event(Q_EVENT_SUSPEND_DISK, NULL); qemu_system_shutdown_request(); } break; diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 533f6dd..9dc1ac7 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -821,7 +821,7 @@ static void device_unparent(Object *obj) } else { event_data = qobject_from_jsonf("{ 'path': %s }", path); } - monitor_protocol_event(QEVENT_DEVICE_DELETED, event_data); + monitor_protocol_event(Q_EVENT_DEVICE_DELETED, event_data); qobject_decref(event_data); g_free(path); } diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index b64e3bb..192b60a 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -36,7 +36,7 @@ static void panicked_mon_event(const char *action) QObject *data; data = qobject_from_jsonf("{ 'action': %s }", action); - monitor_protocol_event(QEVENT_GUEST_PANICKED, data); + monitor_protocol_event(Q_EVENT_GUEST_PANICKED, data); qobject_decref(data); } diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 22dbd05..c35cc8e 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -208,7 +208,7 @@ static void rxfilter_notify(NetClientState *nc) event_data = qobject_from_jsonf("{ 'path': %s }", object_get_canonical_path(OBJECT(n->qdev))); } - monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data); + monitor_protocol_event(Q_EVENT_NIC_RX_FILTER_CHANGED, event_data); qobject_decref(event_data); /* disable event notification to avoid events flooding */ diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 387962e..4501685 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -105,7 +105,7 @@ static void watchdog_mon_event(const char *action) QObject *data; data = qobject_from_jsonf("{ 'action': %s }", action); - monitor_protocol_event(QEVENT_WATCHDOG, data); + monitor_protocol_event(Q_EVENT_WATCHDOG, data); qobject_decref(data); } diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 8b14a6f..b273c5b 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -21,39 +21,39 @@ extern Monitor *default_mon; /* QMP events */ typedef enum QEvent { - QEVENT_SHUTDOWN, - QEVENT_RESET, - QEVENT_POWERDOWN, - QEVENT_STOP, - QEVENT_RESUME, - QEVENT_VNC_CONNECTED, - QEVENT_VNC_INITIALIZED, - QEVENT_VNC_DISCONNECTED, - QEVENT_BLOCK_IO_ERROR, - QEVENT_RTC_CHANGE, - QEVENT_WATCHDOG, - QEVENT_SPICE_CONNECTED, - QEVENT_SPICE_INITIALIZED, - QEVENT_SPICE_DISCONNECTED, - QEVENT_BLOCK_JOB_COMPLETED, - QEVENT_BLOCK_JOB_CANCELLED, - QEVENT_BLOCK_JOB_ERROR, - QEVENT_BLOCK_JOB_READY, - QEVENT_DEVICE_DELETED, - QEVENT_DEVICE_TRAY_MOVED, - QEVENT_NIC_RX_FILTER_CHANGED, - QEVENT_SUSPEND, - QEVENT_SUSPEND_DISK, - QEVENT_WAKEUP, - QEVENT_BALLOON_CHANGE, - QEVENT_SPICE_MIGRATE_COMPLETED, - QEVENT_GUEST_PANICKED, - QEVENT_BLOCK_IMAGE_CORRUPTED, + Q_EVENT_SHUTDOWN, + Q_EVENT_RESET, + Q_EVENT_POWERDOWN, + Q_EVENT_STOP, + Q_EVENT_RESUME, + Q_EVENT_VNC_CONNECTED, + Q_EVENT_VNC_INITIALIZED, + Q_EVENT_VNC_DISCONNECTED, + Q_EVENT_BLOCK_IO_ERROR, + Q_EVENT_RTC_CHANGE, + Q_EVENT_WATCHDOG, + Q_EVENT_SPICE_CONNECTED, + Q_EVENT_SPICE_INITIALIZED, + Q_EVENT_SPICE_DISCONNECTED, + Q_EVENT_BLOCK_JOB_COMPLETED, + Q_EVENT_BLOCK_JOB_CANCELLED, + Q_EVENT_BLOCK_JOB_ERROR, + Q_EVENT_BLOCK_JOB_READY, + Q_EVENT_DEVICE_DELETED, + Q_EVENT_DEVICE_TRAY_MOVED, + Q_EVENT_NIC_RX_FILTER_CHANGED, + Q_EVENT_SUSPEND, + Q_EVENT_SUSPEND_DISK, + Q_EVENT_WAKEUP, + Q_EVENT_BALLOON_CHANGE, + Q_EVENT_SPICE_MIGRATE_COMPLETED, + Q_EVENT_GUEST_PANICKED, + Q_EVENT_BLOCK_IMAGE_CORRUPTED, /* Add to 'monitor_event_names' array in monitor.c when * defining new events here */ - QEVENT_MAX, + Q_EVENT_MAX, } QEvent; int monitor_cur_is_qmp(void); diff --git a/monitor.c b/monitor.c index 9377834..b2c64de 100644 --- a/monitor.c +++ b/monitor.c @@ -479,38 +479,38 @@ static void timestamp_put(QDict *qdict) static const char *monitor_event_names[] = { - [QEVENT_SHUTDOWN] = "SHUTDOWN", - [QEVENT_RESET] = "RESET", - [QEVENT_POWERDOWN] = "POWERDOWN", - [QEVENT_STOP] = "STOP", - [QEVENT_RESUME] = "RESUME", - [QEVENT_VNC_CONNECTED] = "VNC_CONNECTED", - [QEVENT_VNC_INITIALIZED] = "VNC_INITIALIZED", - [QEVENT_VNC_DISCONNECTED] = "VNC_DISCONNECTED", - [QEVENT_BLOCK_IO_ERROR] = "BLOCK_IO_ERROR", - [QEVENT_RTC_CHANGE] = "RTC_CHANGE", - [QEVENT_WATCHDOG] = "WATCHDOG", - [QEVENT_SPICE_CONNECTED] = "SPICE_CONNECTED", - [QEVENT_SPICE_INITIALIZED] = "SPICE_INITIALIZED", - [QEVENT_SPICE_DISCONNECTED] = "SPICE_DISCONNECTED", - [QEVENT_BLOCK_JOB_COMPLETED] = "BLOCK_JOB_COMPLETED", - [QEVENT_BLOCK_JOB_CANCELLED] = "BLOCK_JOB_CANCELLED", - [QEVENT_BLOCK_JOB_ERROR] = "BLOCK_JOB_ERROR", - [QEVENT_BLOCK_JOB_READY] = "BLOCK_JOB_READY", - [QEVENT_DEVICE_DELETED] = "DEVICE_DELETED", - [QEVENT_DEVICE_TRAY_MOVED] = "DEVICE_TRAY_MOVED", - [QEVENT_NIC_RX_FILTER_CHANGED] = "NIC_RX_FILTER_CHANGED", - [QEVENT_SUSPEND] = "SUSPEND", - [QEVENT_SUSPEND_DISK] = "SUSPEND_DISK", - [QEVENT_WAKEUP] = "WAKEUP", - [QEVENT_BALLOON_CHANGE] = "BALLOON_CHANGE", - [QEVENT_SPICE_MIGRATE_COMPLETED] = "SPICE_MIGRATE_COMPLETED", - [QEVENT_GUEST_PANICKED] = "GUEST_PANICKED", - [QEVENT_BLOCK_IMAGE_CORRUPTED] = "BLOCK_IMAGE_CORRUPTED", + [Q_EVENT_SHUTDOWN] = "SHUTDOWN", + [Q_EVENT_RESET] = "RESET", + [Q_EVENT_POWERDOWN] = "POWERDOWN", + [Q_EVENT_STOP] = "STOP", + [Q_EVENT_RESUME] = "RESUME", + [Q_EVENT_VNC_CONNECTED] = "VNC_CONNECTED", + [Q_EVENT_VNC_INITIALIZED] = "VNC_INITIALIZED", + [Q_EVENT_VNC_DISCONNECTED] = "VNC_DISCONNECTED", + [Q_EVENT_BLOCK_IO_ERROR] = "BLOCK_IO_ERROR", + [Q_EVENT_RTC_CHANGE] = "RTC_CHANGE", + [Q_EVENT_WATCHDOG] = "WATCHDOG", + [Q_EVENT_SPICE_CONNECTED] = "SPICE_CONNECTED", + [Q_EVENT_SPICE_INITIALIZED] = "SPICE_INITIALIZED", + [Q_EVENT_SPICE_DISCONNECTED] = "SPICE_DISCONNECTED", + [Q_EVENT_BLOCK_JOB_COMPLETED] = "BLOCK_JOB_COMPLETED", + [Q_EVENT_BLOCK_JOB_CANCELLED] = "BLOCK_JOB_CANCELLED", + [Q_EVENT_BLOCK_JOB_ERROR] = "BLOCK_JOB_ERROR", + [Q_EVENT_BLOCK_JOB_READY] = "BLOCK_JOB_READY", + [Q_EVENT_DEVICE_DELETED] = "DEVICE_DELETED", + [Q_EVENT_DEVICE_TRAY_MOVED] = "DEVICE_TRAY_MOVED", + [Q_EVENT_NIC_RX_FILTER_CHANGED] = "NIC_RX_FILTER_CHANGED", + [Q_EVENT_SUSPEND] = "SUSPEND", + [Q_EVENT_SUSPEND_DISK] = "SUSPEND_DISK", + [Q_EVENT_WAKEUP] = "WAKEUP", + [Q_EVENT_BALLOON_CHANGE] = "BALLOON_CHANGE", + [Q_EVENT_SPICE_MIGRATE_COMPLETED] = "SPICE_MIGRATE_COMPLETED", + [Q_EVENT_GUEST_PANICKED] = "GUEST_PANICKED", + [Q_EVENT_BLOCK_IMAGE_CORRUPTED] = "BLOCK_IMAGE_CORRUPTED", }; -QEMU_BUILD_BUG_ON(ARRAY_SIZE(monitor_event_names) != QEVENT_MAX) +QEMU_BUILD_BUG_ON(ARRAY_SIZE(monitor_event_names) != Q_EVENT_MAX) -MonitorEventState monitor_event_state[QEVENT_MAX]; +MonitorEventState monitor_event_state[Q_EVENT_MAX]; QemuMutex monitor_event_state_lock; /* @@ -541,7 +541,7 @@ monitor_protocol_event_queue(QEvent event, { MonitorEventState *evstate; int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); - assert(event < QEVENT_MAX); + assert(event < Q_EVENT_MAX); qemu_mutex_lock(&monitor_event_state_lock); evstate = &(monitor_event_state[event]); @@ -618,7 +618,7 @@ monitor_protocol_event_throttle(QEvent event, int64_t rate) { MonitorEventState *evstate; - assert(event < QEVENT_MAX); + assert(event < Q_EVENT_MAX); evstate = &(monitor_event_state[event]); @@ -640,9 +640,9 @@ static void monitor_protocol_event_init(void) { qemu_mutex_init(&monitor_event_state_lock); /* Limit RTC & BALLOON events to 1 per second */ - monitor_protocol_event_throttle(QEVENT_RTC_CHANGE, 1000); - monitor_protocol_event_throttle(QEVENT_BALLOON_CHANGE, 1000); - monitor_protocol_event_throttle(QEVENT_WATCHDOG, 1000); + monitor_protocol_event_throttle(Q_EVENT_RTC_CHANGE, 1000); + monitor_protocol_event_throttle(Q_EVENT_BALLOON_CHANGE, 1000); + monitor_protocol_event_throttle(Q_EVENT_WATCHDOG, 1000); } /** @@ -655,7 +655,7 @@ void monitor_protocol_event(QEvent event, QObject *data) QDict *qmp; const char *event_name; - assert(event < QEVENT_MAX); + assert(event < Q_EVENT_MAX); event_name = monitor_event_names[event]; assert(event_name != NULL); @@ -1069,7 +1069,7 @@ EventInfoList *qmp_query_events(Error **errp) EventInfoList *info, *ev_list = NULL; QEvent e; - for (e = 0 ; e < QEVENT_MAX ; e++) { + for (e = 0 ; e < Q_EVENT_MAX ; e++) { const char *event_name = monitor_event_names[e]; assert(event_name != NULL); info = g_malloc0(sizeof(*info)); diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 02ac4ba..b09a7d2 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -736,7 +736,7 @@ static int handle_intercept(S390CPU *cpu) QObject *data; data = qobject_from_jsonf("{ 'action': %s }", "pause"); - monitor_protocol_event(QEVENT_GUEST_PANICKED, data); + monitor_protocol_event(Q_EVENT_GUEST_PANICKED, data); qobject_decref(data); vm_stop(RUN_STATE_GUEST_PANICKED); } diff --git a/ui/spice-core.c b/ui/spice-core.c index e4d533d..f3c6795 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -199,9 +199,9 @@ static void add_channel_info(QDict *dict, SpiceChannelEventInfo *info) static void channel_event(int event, SpiceChannelEventInfo *info) { static const int qevent[] = { - [ SPICE_CHANNEL_EVENT_CONNECTED ] = QEVENT_SPICE_CONNECTED, - [ SPICE_CHANNEL_EVENT_INITIALIZED ] = QEVENT_SPICE_INITIALIZED, - [ SPICE_CHANNEL_EVENT_DISCONNECTED ] = QEVENT_SPICE_DISCONNECTED, + [SPICE_CHANNEL_EVENT_CONNECTED] = Q_EVENT_SPICE_CONNECTED, + [SPICE_CHANNEL_EVENT_INITIALIZED] = Q_EVENT_SPICE_INITIALIZED, + [SPICE_CHANNEL_EVENT_DISCONNECTED] = Q_EVENT_SPICE_DISCONNECTED, }; QDict *server, *client; QObject *data; @@ -303,7 +303,7 @@ static void migrate_connect_complete_cb(SpiceMigrateInstance *sin) static void migrate_end_complete_cb(SpiceMigrateInstance *sin) { - monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL); + monitor_protocol_event(Q_EVENT_SPICE_MIGRATE_COMPLETED, NULL); spice_migration_completed = true; } diff --git a/ui/vnc.c b/ui/vnc.c index 47fda54..b7c6f63 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1033,7 +1033,7 @@ void vnc_disconnect_finish(VncState *vs) vnc_jobs_join(vs); /* Wait encoding jobs */ vnc_lock_output(vs); - vnc_qmp_event(vs, QEVENT_VNC_DISCONNECTED); + vnc_qmp_event(vs, Q_EVENT_VNC_DISCONNECTED); buffer_free(&vs->input); buffer_free(&vs->output); @@ -2315,7 +2315,7 @@ static int protocol_client_init(VncState *vs, uint8_t *data, size_t len) vnc_flush(vs); vnc_client_cache_auth(vs); - vnc_qmp_event(vs, QEVENT_VNC_INITIALIZED); + vnc_qmp_event(vs, Q_EVENT_VNC_INITIALIZED); vnc_read_when(vs, protocol_client_msg, 1); @@ -2819,7 +2819,7 @@ static void vnc_connect(VncDisplay *vd, int csock, } vnc_client_cache_addr(vs); - vnc_qmp_event(vs, QEVENT_VNC_CONNECTED); + vnc_qmp_event(vs, Q_EVENT_VNC_CONNECTED); vnc_set_share_mode(vs, VNC_SHARE_MODE_CONNECTING); vs->vd = vd; diff --git a/vl.c b/vl.c index b42ac67..6586072 100644 --- a/vl.c +++ b/vl.c @@ -746,7 +746,7 @@ void rtc_change_mon_event(struct tm *tm) QObject *data; data = qobject_from_jsonf("{ 'offset': %d }", qemu_timedate_diff(tm)); - monitor_protocol_event(QEVENT_RTC_CHANGE, data); + monitor_protocol_event(Q_EVENT_RTC_CHANGE, data); qobject_decref(data); } @@ -1699,7 +1699,7 @@ void vm_start(void) runstate_set(RUN_STATE_RUNNING); vm_state_notify(1, RUN_STATE_RUNNING); resume_all_vcpus(); - monitor_protocol_event(QEVENT_RESUME, NULL); + monitor_protocol_event(Q_EVENT_RESUME, NULL); } } @@ -1847,7 +1847,7 @@ void qemu_system_reset(bool report) qemu_devices_reset(); } if (report) { - monitor_protocol_event(QEVENT_RESET, NULL); + monitor_protocol_event(Q_EVENT_RESET, NULL); } cpu_synchronize_all_post_reset(); } @@ -1868,7 +1868,7 @@ static void qemu_system_suspend(void) pause_all_vcpus(); notifier_list_notify(&suspend_notifiers, NULL); runstate_set(RUN_STATE_SUSPENDED); - monitor_protocol_event(QEVENT_SUSPEND, NULL); + monitor_protocol_event(Q_EVENT_SUSPEND, NULL); } void qemu_system_suspend_request(void) @@ -1929,7 +1929,7 @@ void qemu_system_shutdown_request(void) static void qemu_system_powerdown(void) { - monitor_protocol_event(QEVENT_POWERDOWN, NULL); + monitor_protocol_event(Q_EVENT_POWERDOWN, NULL); notifier_list_notify(&powerdown_notifiers, NULL); } @@ -1967,7 +1967,7 @@ static bool main_loop_should_exit(void) } if (qemu_shutdown_requested()) { qemu_kill_report(); - monitor_protocol_event(QEVENT_SHUTDOWN, NULL); + monitor_protocol_event(Q_EVENT_SHUTDOWN, NULL); if (no_shutdown) { vm_stop(RUN_STATE_SHUTDOWN); } else { @@ -1990,7 +1990,7 @@ static bool main_loop_should_exit(void) notifier_list_notify(&wakeup_notifiers, &wakeup_reason); wakeup_reason = QEMU_WAKEUP_REASON_NONE; resume_all_vcpus(); - monitor_protocol_event(QEVENT_WAKEUP, NULL); + monitor_protocol_event(Q_EVENT_WAKEUP, NULL); } if (qemu_powerdown_requested()) { qemu_system_powerdown();