All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event
@ 2014-06-24 23:33 Wenchao Xia
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31 Wenchao Xia
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Wenchao Xia @ 2014-06-24 23:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru, Wenchao Xia, lcapitulino


Paolo Bonzini (1):
  tests/test-qmp-event: fix for GLib < 2.31

Wenchao Xia (4):
  qapi: move event defines
  qapi: ignore generated event files
  qapi script: clean up in scripts
  qapi event: clean up in callers

 .gitignore                              |    1 +
 Makefile                                |    2 +-
 docs/qapi-code-gen.txt                  |    8 +-
 hw/watchdog/watchdog.c                  |    2 +-
 include/block/blockjob.h                |    2 +-
 monitor.c                               |    2 +-
 qapi-event.json                         |  318 -------------------------------
 qapi-schema.json                        |   12 +-
 qapi/block-core.json                    |    3 +-
 qapi/event.json                         |  318 +++++++++++++++++++++++++++++++
 scripts/qapi-event.py                   |    5 +-
 scripts/qapi.py                         |    2 +-
 tests/qapi-schema/event-nest-struct.err |    2 +-
 tests/test-qmp-event.c                  |    1 +
 14 files changed, 341 insertions(+), 337 deletions(-)
 delete mode 100644 qapi-event.json
 create mode 100644 qapi/event.json

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
@ 2014-06-24 23:33 ` Wenchao Xia
  2014-06-25 13:13   ` Luiz Capitulino
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 2/5] qapi: move event defines Wenchao Xia
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Wenchao Xia @ 2014-06-24 23:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru, Wenchao Xia, lcapitulino

From: Paolo Bonzini <pbonzini@redhat.com>

On old GLib, the test needs a g_thread_init call.

Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 tests/test-qmp-event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index cb1e441..17c6444 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
 
 int main(int argc, char **argv)
 {
+    g_thread_init(NULL);
     qmp_event_set_func_emit(event_test_emit);
 
     g_test_init(&argc, &argv, NULL);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PATCH FOR 2.1 2/5] qapi: move event defines
  2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31 Wenchao Xia
@ 2014-06-24 23:33 ` Wenchao Xia
  2014-06-25  2:15   ` Eric Blake
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 3/5] qapi: ignore generated event files Wenchao Xia
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Wenchao Xia @ 2014-06-24 23:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru, Wenchao Xia, lcapitulino

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 Makefile         |    2 +-
 qapi-event.json  |  318 ------------------------------------------------------
 qapi-schema.json |    5 +-
 qapi/event.json  |  318 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 322 insertions(+), 321 deletions(-)
 delete mode 100644 qapi-event.json
 create mode 100644 qapi/event.json

diff --git a/Makefile b/Makefile
index 145adb6..1eea0c4 100644
--- a/Makefile
+++ b/Makefile
@@ -248,7 +248,7 @@ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 
 qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
                $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
-               $(SRC_PATH)/qapi-event.json
+               $(SRC_PATH)/qapi/event.json
 
 qapi-types.c qapi-types.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
diff --git a/qapi-event.json b/qapi-event.json
deleted file mode 100644
index e7a47f9..0000000
--- a/qapi-event.json
+++ /dev/null
@@ -1,318 +0,0 @@
-##
-# @SHUTDOWN
-#
-# Emitted when the virtual machine has shutdown, possibly indicating that QEMU
-# is about about to exit.
-#
-# Note: If the command-line option "-no-shutdown" has been specified, qemu will
-# not exit, and a STOP event will eventually follow the SHUTDOWN event
-#
-# Since: 0.12.0
-##
-{ 'event': 'SHUTDOWN' }
-
-##
-# @POWERDOWN
-#
-# Emitted when the virtual machine is powered down through the power control
-# system, such as via ACPI.
-#
-# Since: 0.12.0
-##
-{ 'event': 'POWERDOWN' }
-
-##
-# @RESET
-#
-# Emitted when the virtual machine is reset
-#
-# Since: 0.12.0
-##
-{ 'event': 'RESET' }
-
-##
-# @STOP
-#
-# Emitted when the virtual machine is stopped
-#
-# Since: 0.12.0
-##
-{ 'event': 'STOP' }
-
-##
-# @RESUME
-#
-# Emitted when the virtual machine resumes execution
-#
-# Since: 0.12.0
-##
-{ 'event': 'RESUME' }
-
-##
-# @SUSPEND
-#
-# Emitted when guest enters a hardware suspension state, for example, S3 state,
-# which is sometimes called standby state
-#
-# Since: 1.1
-##
-{ 'event': 'SUSPEND' }
-
-##
-# @SUSPEND_DISK
-#
-# Emitted when guest enters a hardware suspension state with data saved on
-# disk, for example, S4 state, which is sometimes called hibernate state
-#
-# Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
-#
-# Since: 1.2
-##
-{ 'event': 'SUSPEND_DISK' }
-
-##
-# @WAKEUP
-#
-# Emitted when the guest has woken up from suspend state and is running
-#
-# Since: 1.1
-##
-{ 'event': 'WAKEUP' }
-
-##
-# @RTC_CHANGE
-#
-# Emitted when the guest changes the RTC time.
-#
-# @offset: offset between base RTC clock (as specified by -rtc base), and
-#          new RTC clock value
-#
-# Since: 0.13.0
-##
-{ 'event': 'RTC_CHANGE',
-  'data': { 'offset': 'int' } }
-
-##
-# @WATCHDOG
-#
-# Emitted when the watchdog device's timer is expired
-#
-# @action: action that has been taken
-#
-# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
-# followed respectively by the RESET, SHUTDOWN, or STOP events
-#
-# Since: 0.13.0
-##
-{ 'event': 'WATCHDOG',
-  'data': { 'action': 'WatchdogExpirationAction' } }
-
-##
-# @DEVICE_DELETED
-#
-# Emitted whenever the device removal completion is acknowledged by the guest.
-# At this point, it's safe to reuse the specified device ID. Device removal can
-# be initiated by the guest or by HMP/QMP commands.
-#
-# @device: #optional, device name
-#
-# @path: device path
-#
-# Since: 1.5
-##
-{ 'event': 'DEVICE_DELETED',
-  'data': { '*device': 'str', 'path': 'str' } }
-
-##
-# @NIC_RX_FILTER_CHANGED
-#
-# Emitted once until the 'query-rx-filter' command is executed, the first event
-# will always be emitted
-#
-# @name: #optional, net client name
-#
-# @path: device path
-#
-# Since: 1.6
-##
-{ 'event': 'NIC_RX_FILTER_CHANGED',
-  'data': { '*name': 'str', 'path': 'str' } }
-
-##
-# @VNC_CONNECTED
-#
-# Emitted when a VNC client establishes a connection
-#
-# @server: server information
-#
-# @client: client information
-#
-# Note: This event is emitted before any authentication takes place, thus
-# the authentication ID is not provided
-#
-# Since: 0.13.0
-##
-{ 'event': 'VNC_CONNECTED',
-  'data': { 'server': 'VncServerInfo',
-            'client': 'VncBasicInfo' } }
-
-##
-# @VNC_INITIALIZED
-#
-# Emitted after authentication takes place (if any) and the VNC session is
-# made active
-#
-# @server: server information
-#
-# @client: client information
-#
-# Since: 0.13.0
-##
-{ 'event': 'VNC_INITIALIZED',
-  'data': { 'server': 'VncServerInfo',
-            'client': 'VncClientInfo' } }
-
-##
-# @VNC_DISCONNECTED
-#
-# Emitted when the connection is closed
-#
-# @server: server information
-#
-# @client: client information
-#
-# Since: 0.13.0
-##
-{ 'event': 'VNC_DISCONNECTED',
-  'data': { 'server': 'VncServerInfo',
-            'client': 'VncClientInfo' } }
-
-##
-# @SPICE_CONNECTED
-#
-# Emitted when a SPICE client establishes a connection
-#
-# @server: server information
-#
-# @client: client information
-#
-# Since: 0.14.0
-##
-{ 'event': 'SPICE_CONNECTED',
-  'data': { 'server': 'SpiceBasicInfo',
-            'client': 'SpiceBasicInfo' } }
-
-##
-# @SPICE_INITIALIZED
-#
-# Emitted after initial handshake and authentication takes place (if any)
-# and the SPICE channel is up and running
-#
-# @server: server information
-#
-# @client: client information
-#
-# Since: 0.14.0
-##
-{ 'event': 'SPICE_INITIALIZED',
-  'data': { 'server': 'SpiceServerInfo',
-            'client': 'SpiceChannel' } }
-
-##
-# @SPICE_DISCONNECTED
-#
-# Emitted when the SPICE connection is closed
-#
-# @server: server information
-#
-# @client: client information
-#
-# Since: 0.14.0
-##
-{ 'event': 'SPICE_DISCONNECTED',
-  'data': { 'server': 'SpiceBasicInfo',
-            'client': 'SpiceBasicInfo' } }
-
-##
-# @SPICE_MIGRATE_COMPLETED
-#
-# Emitted when SPICE migration has completed
-#
-# Since: 1.3
-##
-{ 'event': 'SPICE_MIGRATE_COMPLETED' }
-
-##
-# @ACPI_DEVICE_OST
-#
-# Emitted when guest executes ACPI _OST method.
-#
-# Since: 2.1
-#
-# @info: ACPIOSTInfo type as described in qapi-schema.json
-##
-{ 'event': 'ACPI_DEVICE_OST',
-     'data': { 'info': 'ACPIOSTInfo' } }
-
-##
-# @BALLOON_CHANGE
-#
-# Emitted when the guest changes the actual BALLOON level. This value is
-# equivalent to the @actual field return by the 'query-balloon' command
-#
-# @actual: actual level of the guest memory balloon in bytes
-#
-# Since: 1.2
-##
-{ 'event': 'BALLOON_CHANGE',
-  'data': { 'actual': 'int' } }
-
-##
-# @GUEST_PANICKED
-#
-# Emitted when guest OS panic is detected
-#
-# @action: action that has been taken, currently always "pause"
-#
-# Since: 1.5
-##
-{ 'event': 'GUEST_PANICKED',
-  'data': { 'action': 'GuestPanicAction' } }
-
-##
-# @QUORUM_FAILURE
-#
-# Emitted by the Quorum block driver if it fails to establish a quorum
-#
-# @reference: device name if defined else node name
-#
-# @sector-num: number of the first sector of the failed read operation
-#
-# @sector-count: failed read operation sector count
-#
-# Since: 2.0
-##
-{ 'event': 'QUORUM_FAILURE',
-  'data': { 'reference': 'str', 'sector-num': 'int', 'sector-count': 'int' } }
-
-##
-# @QUORUM_REPORT_BAD
-#
-# Emitted to report a corruption of a Quorum file
-#
-# @error: #optional, error message. Only present on failure. This field
-#         contains a human-readable error message. There are no semantics other
-#         than that the block layer reported an error and clients should not
-#         try to interpret the error string.
-#
-# @node-name: the graph node name of the block driver state
-#
-# @sector-num: number of the first sector of the failed read operation
-#
-# @sector-count: failed read operation sector count
-#
-# Since: 2.0
-##
-{ 'event': 'QUORUM_REPORT_BAD',
-  'data': { '*error': 'str', 'node-name': 'str',
-            'sector-num': 'int', 'sector-count': 'int' } }
diff --git a/qapi-schema.json b/qapi-schema.json
index e7727a1..37c2189 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -8,6 +8,9 @@
 # QAPI block definitions
 { 'include': 'qapi/block.json' }
 
+# QAPI event definitions
+{ 'include': 'qapi/event.json' }
+
 ##
 # LostTickPolicy:
 #
@@ -3398,5 +3401,3 @@
 ##
 { 'enum': 'GuestPanicAction',
   'data': [ 'pause' ] }
-
-{ 'include': 'qapi-event.json' }
diff --git a/qapi/event.json b/qapi/event.json
new file mode 100644
index 0000000..e7a47f9
--- /dev/null
+++ b/qapi/event.json
@@ -0,0 +1,318 @@
+##
+# @SHUTDOWN
+#
+# Emitted when the virtual machine has shutdown, possibly indicating that QEMU
+# is about about to exit.
+#
+# Note: If the command-line option "-no-shutdown" has been specified, qemu will
+# not exit, and a STOP event will eventually follow the SHUTDOWN event
+#
+# Since: 0.12.0
+##
+{ 'event': 'SHUTDOWN' }
+
+##
+# @POWERDOWN
+#
+# Emitted when the virtual machine is powered down through the power control
+# system, such as via ACPI.
+#
+# Since: 0.12.0
+##
+{ 'event': 'POWERDOWN' }
+
+##
+# @RESET
+#
+# Emitted when the virtual machine is reset
+#
+# Since: 0.12.0
+##
+{ 'event': 'RESET' }
+
+##
+# @STOP
+#
+# Emitted when the virtual machine is stopped
+#
+# Since: 0.12.0
+##
+{ 'event': 'STOP' }
+
+##
+# @RESUME
+#
+# Emitted when the virtual machine resumes execution
+#
+# Since: 0.12.0
+##
+{ 'event': 'RESUME' }
+
+##
+# @SUSPEND
+#
+# Emitted when guest enters a hardware suspension state, for example, S3 state,
+# which is sometimes called standby state
+#
+# Since: 1.1
+##
+{ 'event': 'SUSPEND' }
+
+##
+# @SUSPEND_DISK
+#
+# Emitted when guest enters a hardware suspension state with data saved on
+# disk, for example, S4 state, which is sometimes called hibernate state
+#
+# Note: QEMU shuts down (similar to event @SHUTDOWN) when entering this state
+#
+# Since: 1.2
+##
+{ 'event': 'SUSPEND_DISK' }
+
+##
+# @WAKEUP
+#
+# Emitted when the guest has woken up from suspend state and is running
+#
+# Since: 1.1
+##
+{ 'event': 'WAKEUP' }
+
+##
+# @RTC_CHANGE
+#
+# Emitted when the guest changes the RTC time.
+#
+# @offset: offset between base RTC clock (as specified by -rtc base), and
+#          new RTC clock value
+#
+# Since: 0.13.0
+##
+{ 'event': 'RTC_CHANGE',
+  'data': { 'offset': 'int' } }
+
+##
+# @WATCHDOG
+#
+# Emitted when the watchdog device's timer is expired
+#
+# @action: action that has been taken
+#
+# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
+# followed respectively by the RESET, SHUTDOWN, or STOP events
+#
+# Since: 0.13.0
+##
+{ 'event': 'WATCHDOG',
+  'data': { 'action': 'WatchdogExpirationAction' } }
+
+##
+# @DEVICE_DELETED
+#
+# Emitted whenever the device removal completion is acknowledged by the guest.
+# At this point, it's safe to reuse the specified device ID. Device removal can
+# be initiated by the guest or by HMP/QMP commands.
+#
+# @device: #optional, device name
+#
+# @path: device path
+#
+# Since: 1.5
+##
+{ 'event': 'DEVICE_DELETED',
+  'data': { '*device': 'str', 'path': 'str' } }
+
+##
+# @NIC_RX_FILTER_CHANGED
+#
+# Emitted once until the 'query-rx-filter' command is executed, the first event
+# will always be emitted
+#
+# @name: #optional, net client name
+#
+# @path: device path
+#
+# Since: 1.6
+##
+{ 'event': 'NIC_RX_FILTER_CHANGED',
+  'data': { '*name': 'str', 'path': 'str' } }
+
+##
+# @VNC_CONNECTED
+#
+# Emitted when a VNC client establishes a connection
+#
+# @server: server information
+#
+# @client: client information
+#
+# Note: This event is emitted before any authentication takes place, thus
+# the authentication ID is not provided
+#
+# Since: 0.13.0
+##
+{ 'event': 'VNC_CONNECTED',
+  'data': { 'server': 'VncServerInfo',
+            'client': 'VncBasicInfo' } }
+
+##
+# @VNC_INITIALIZED
+#
+# Emitted after authentication takes place (if any) and the VNC session is
+# made active
+#
+# @server: server information
+#
+# @client: client information
+#
+# Since: 0.13.0
+##
+{ 'event': 'VNC_INITIALIZED',
+  'data': { 'server': 'VncServerInfo',
+            'client': 'VncClientInfo' } }
+
+##
+# @VNC_DISCONNECTED
+#
+# Emitted when the connection is closed
+#
+# @server: server information
+#
+# @client: client information
+#
+# Since: 0.13.0
+##
+{ 'event': 'VNC_DISCONNECTED',
+  'data': { 'server': 'VncServerInfo',
+            'client': 'VncClientInfo' } }
+
+##
+# @SPICE_CONNECTED
+#
+# Emitted when a SPICE client establishes a connection
+#
+# @server: server information
+#
+# @client: client information
+#
+# Since: 0.14.0
+##
+{ 'event': 'SPICE_CONNECTED',
+  'data': { 'server': 'SpiceBasicInfo',
+            'client': 'SpiceBasicInfo' } }
+
+##
+# @SPICE_INITIALIZED
+#
+# Emitted after initial handshake and authentication takes place (if any)
+# and the SPICE channel is up and running
+#
+# @server: server information
+#
+# @client: client information
+#
+# Since: 0.14.0
+##
+{ 'event': 'SPICE_INITIALIZED',
+  'data': { 'server': 'SpiceServerInfo',
+            'client': 'SpiceChannel' } }
+
+##
+# @SPICE_DISCONNECTED
+#
+# Emitted when the SPICE connection is closed
+#
+# @server: server information
+#
+# @client: client information
+#
+# Since: 0.14.0
+##
+{ 'event': 'SPICE_DISCONNECTED',
+  'data': { 'server': 'SpiceBasicInfo',
+            'client': 'SpiceBasicInfo' } }
+
+##
+# @SPICE_MIGRATE_COMPLETED
+#
+# Emitted when SPICE migration has completed
+#
+# Since: 1.3
+##
+{ 'event': 'SPICE_MIGRATE_COMPLETED' }
+
+##
+# @ACPI_DEVICE_OST
+#
+# Emitted when guest executes ACPI _OST method.
+#
+# Since: 2.1
+#
+# @info: ACPIOSTInfo type as described in qapi-schema.json
+##
+{ 'event': 'ACPI_DEVICE_OST',
+     'data': { 'info': 'ACPIOSTInfo' } }
+
+##
+# @BALLOON_CHANGE
+#
+# Emitted when the guest changes the actual BALLOON level. This value is
+# equivalent to the @actual field return by the 'query-balloon' command
+#
+# @actual: actual level of the guest memory balloon in bytes
+#
+# Since: 1.2
+##
+{ 'event': 'BALLOON_CHANGE',
+  'data': { 'actual': 'int' } }
+
+##
+# @GUEST_PANICKED
+#
+# Emitted when guest OS panic is detected
+#
+# @action: action that has been taken, currently always "pause"
+#
+# Since: 1.5
+##
+{ 'event': 'GUEST_PANICKED',
+  'data': { 'action': 'GuestPanicAction' } }
+
+##
+# @QUORUM_FAILURE
+#
+# Emitted by the Quorum block driver if it fails to establish a quorum
+#
+# @reference: device name if defined else node name
+#
+# @sector-num: number of the first sector of the failed read operation
+#
+# @sector-count: failed read operation sector count
+#
+# Since: 2.0
+##
+{ 'event': 'QUORUM_FAILURE',
+  'data': { 'reference': 'str', 'sector-num': 'int', 'sector-count': 'int' } }
+
+##
+# @QUORUM_REPORT_BAD
+#
+# Emitted to report a corruption of a Quorum file
+#
+# @error: #optional, error message. Only present on failure. This field
+#         contains a human-readable error message. There are no semantics other
+#         than that the block layer reported an error and clients should not
+#         try to interpret the error string.
+#
+# @node-name: the graph node name of the block driver state
+#
+# @sector-num: number of the first sector of the failed read operation
+#
+# @sector-count: failed read operation sector count
+#
+# Since: 2.0
+##
+{ 'event': 'QUORUM_REPORT_BAD',
+  'data': { '*error': 'str', 'node-name': 'str',
+            'sector-num': 'int', 'sector-count': 'int' } }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PATCH FOR 2.1 3/5] qapi: ignore generated event files
  2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31 Wenchao Xia
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 2/5] qapi: move event defines Wenchao Xia
@ 2014-06-24 23:33 ` Wenchao Xia
  2014-06-25  2:20   ` Eric Blake
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 4/5] qapi script: clean up in scripts Wenchao Xia
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Wenchao Xia @ 2014-06-24 23:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru, Wenchao Xia, lcapitulino

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 .gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index c658613..2286d0a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@
 /qapi-generated
 /qapi-types.[ch]
 /qapi-visit.[ch]
+/qapi-event.[ch]
 /qmp-commands.h
 /qmp-marshal.c
 /qemu-doc.html
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PATCH FOR 2.1 4/5] qapi script: clean up in scripts
  2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
                   ` (2 preceding siblings ...)
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 3/5] qapi: ignore generated event files Wenchao Xia
@ 2014-06-24 23:33 ` Wenchao Xia
  2014-06-25  2:39   ` Eric Blake
  2014-06-24 23:34 ` [Qemu-devel] [PATCH FOR 2.1 5/5] qapi event: clean up in callers Wenchao Xia
  2014-06-25 15:36 ` [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Luiz Capitulino
  5 siblings, 1 reply; 17+ messages in thread
From: Wenchao Xia @ 2014-06-24 23:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru, Wenchao Xia, lcapitulino

This patch improve docs and uses c_type(argentry, is_param=True)
in script.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 docs/qapi-code-gen.txt                  |    8 ++++----
 scripts/qapi-event.py                   |    5 ++---
 scripts/qapi.py                         |    2 +-
 tests/qapi-schema/event-nest-struct.err |    2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt
index 3a0c99e..a6197a9 100644
--- a/docs/qapi-code-gen.txt
+++ b/docs/qapi-code-gen.txt
@@ -218,10 +218,10 @@ An example command is:
 === Events ===
 
 Events are defined with the keyword 'event'.  When 'data' is also specified,
-additional info will be carried on.  Finally there will be C API generated
-in qapi-event.h; when called by QEMU code, a message with timestamp will
-be emitted on the wire.  If timestamp is -1, it means failure to retrieve host
-time.
+additional info will be included in the event.  Finally there will be C API
+generated in qapi-event.h; when called by QEMU code, a message with timestamp
+will be emitted on the wire.  If timestamp is -1, it means failure to retrieve
+host time.
 
 An example event is:
 
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 3a1cd61..601e307 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -26,9 +26,8 @@ def _generate_event_api_name(event_name, params):
                 api_name += "bool has_%s,\n" % c_var(argname)
                 api_name += "".ljust(l)
 
-            if argentry == "str":
-                api_name += "const "
-            api_name += "%s %s,\n" % (c_type(argentry), c_var(argname))
+            api_name += "%s %s,\n" % (c_type(argentry, is_param=True),
+                                      c_var(argname))
             api_name += "".ljust(l)
 
     api_name += "Error **errp)"
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 54b97cb..f2c6d1f 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -255,7 +255,7 @@ def check_event(expr, expr_info):
             if structured:
                 raise QAPIExprError(expr_info,
                                     "Nested structure define in event is not "
-                                    "supported now, event '%s', argname '%s'"
+                                    "supported, event '%s', argname '%s'"
                                     % (expr['event'], argname))
 
 def check_union(expr, expr_info):
diff --git a/tests/qapi-schema/event-nest-struct.err b/tests/qapi-schema/event-nest-struct.err
index e4a0faa..91bde1c 100644
--- a/tests/qapi-schema/event-nest-struct.err
+++ b/tests/qapi-schema/event-nest-struct.err
@@ -1 +1 @@
-tests/qapi-schema/event-nest-struct.json:1: Nested structure define in event is not supported now, event 'EVENT_A', argname 'a'
+tests/qapi-schema/event-nest-struct.json:1: Nested structure define in event is not supported, event 'EVENT_A', argname 'a'
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Qemu-devel] [PATCH FOR 2.1 5/5] qapi event: clean up in callers
  2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
                   ` (3 preceding siblings ...)
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 4/5] qapi script: clean up in scripts Wenchao Xia
@ 2014-06-24 23:34 ` Wenchao Xia
  2014-06-25  2:48   ` Eric Blake
  2014-06-25 15:36 ` [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Luiz Capitulino
  5 siblings, 1 reply; 17+ messages in thread
From: Wenchao Xia @ 2014-06-24 23:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru, Wenchao Xia, lcapitulino

This patch improves docs and address small issues in event
callers.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 hw/watchdog/watchdog.c   |    2 +-
 include/block/blockjob.h |    2 +-
 monitor.c                |    2 +-
 qapi-schema.json         |    7 ++++---
 qapi/block-core.json     |    3 ++-
 qapi/event.json          |    4 ++--
 6 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 4aebd34..9f607d4 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -106,7 +106,7 @@ int select_watchdog_action(const char *p)
  */
 void watchdog_perform_action(void)
 {
-    switch(watchdog_action) {
+    switch (watchdog_action) {
     case WDT_RESET:             /* same as 'system_reset' in monitor */
         qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_RESET, &error_abort);
         qemu_system_reset_request();
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index e443987..cc765b5 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -217,7 +217,7 @@ void block_job_pause(BlockJob *job);
 void block_job_resume(BlockJob *job);
 
 /**
- * block_job_event_cancle:
+ * block_job_event_cancelled:
  * @job: The job whose information is requested.
  *
  * Send a BLOCK_JOB_CANCELLED event for the specified job.
diff --git a/monitor.c b/monitor.c
index a8ab600..fd34ab7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -570,6 +570,7 @@ monitor_qapi_event_throttle(QAPIEvent event, int64_t rate)
 
     trace_monitor_protocol_event_throttle(event, rate);
     evstate->event = event;
+    assert(rate * SCALE_MS <= INT64_MAX);
     evstate->rate = rate * SCALE_MS;
     evstate->last = 0;
     evstate->data = NULL;
@@ -585,7 +586,6 @@ static void monitor_qapi_event_init(void)
     monitor_qapi_event_throttle(QAPI_EVENT_RTC_CHANGE, 1000);
     monitor_qapi_event_throttle(QAPI_EVENT_WATCHDOG, 1000);
     monitor_qapi_event_throttle(QAPI_EVENT_BALLOON_CHANGE, 1000);
-    /* limit the rate of quorum events to avoid hammering the management */
     monitor_qapi_event_throttle(QAPI_EVENT_QUORUM_REPORT_BAD, 1000);
     monitor_qapi_event_throttle(QAPI_EVENT_QUORUM_FAILURE, 1000);
 
diff --git a/qapi-schema.json b/qapi-schema.json
index 37c2189..c68a17f 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -657,8 +657,9 @@
 #
 # @host: IP address
 #
-# @service: The service name of vnc port. This may depend on the host system's
-#           service database so symbolic names should not be relied on.
+# @service: The service name of the vnc port. This may depend on the host
+#           system's service database so symbolic names should not be relied
+#           on.
 #
 # @family: address family
 #
@@ -697,7 +698,7 @@
 ##
 { 'type': 'VncClientInfo',
   'base': 'VncBasicInfo',
-  'data': { '*x509_dname'   : 'str', '*sasl_username': 'str' } }
+  'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
 
 ##
 # @VncInfo:
diff --git a/qapi/block-core.json b/qapi/block-core.json
index af6b436..925e53e 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1436,7 +1436,8 @@
 # @device: device name
 #
 # @msg: informative message for human consumption, such as the kind of
-#       corruption being detected
+#       corruption being detected. It should not be parsed by machine as it is
+#       not guaranteed to be stable
 #
 # @offset: #optional, if the corruption resulted from an image access, this is
 #          the access offset into the image
diff --git a/qapi/event.json b/qapi/event.json
index e7a47f9..8f817b1 100644
--- a/qapi/event.json
+++ b/qapi/event.json
@@ -1,8 +1,8 @@
 ##
 # @SHUTDOWN
 #
-# Emitted when the virtual machine has shutdown, possibly indicating that QEMU
-# is about about to exit.
+# Emitted when the virtual machine has shut down, indicating that qemu is
+# about to exit.
 #
 # Note: If the command-line option "-no-shutdown" has been specified, qemu will
 # not exit, and a STOP event will eventually follow the SHUTDOWN event
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 2/5] qapi: move event defines
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 2/5] qapi: move event defines Wenchao Xia
@ 2014-06-25  2:15   ` Eric Blake
  0 siblings, 0 replies; 17+ messages in thread
From: Eric Blake @ 2014-06-25  2:15 UTC (permalink / raw)
  To: Wenchao Xia, qemu-devel; +Cc: pbonzini, armbru, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

On 06/24/2014 05:33 PM, Wenchao Xia wrote:
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  Makefile         |    2 +-
>  qapi-event.json  |  318 ------------------------------------------------------
>  qapi-schema.json |    5 +-
>  qapi/event.json  |  318 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 322 insertions(+), 321 deletions(-)
>  delete mode 100644 qapi-event.json
>  create mode 100644 qapi/event.json

Please run:
git config diff.renames true

then this patch would be MUCH smaller on the list.

Fortunately, it was a fairly easy review.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 3/5] qapi: ignore generated event files
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 3/5] qapi: ignore generated event files Wenchao Xia
@ 2014-06-25  2:20   ` Eric Blake
  0 siblings, 0 replies; 17+ messages in thread
From: Eric Blake @ 2014-06-25  2:20 UTC (permalink / raw)
  To: Wenchao Xia, qemu-devel; +Cc: pbonzini, armbru, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

On 06/24/2014 05:33 PM, Wenchao Xia wrote:
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  .gitignore |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/.gitignore b/.gitignore
> index c658613..2286d0a 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -26,6 +26,7 @@
>  /qapi-generated
>  /qapi-types.[ch]
>  /qapi-visit.[ch]
> +/qapi-event.[ch]
>  /qmp-commands.h
>  /qmp-marshal.c
>  /qemu-doc.html
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 4/5] qapi script: clean up in scripts
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 4/5] qapi script: clean up in scripts Wenchao Xia
@ 2014-06-25  2:39   ` Eric Blake
  0 siblings, 0 replies; 17+ messages in thread
From: Eric Blake @ 2014-06-25  2:39 UTC (permalink / raw)
  To: Wenchao Xia, qemu-devel; +Cc: pbonzini, armbru, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On 06/24/2014 05:33 PM, Wenchao Xia wrote:
> This patch improve docs and uses c_type(argentry, is_param=True)
> in script.
> 
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  docs/qapi-code-gen.txt                  |    8 ++++----
>  scripts/qapi-event.py                   |    5 ++---
>  scripts/qapi.py                         |    2 +-
>  tests/qapi-schema/event-nest-struct.err |    2 +-
>  4 files changed, 8 insertions(+), 9 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 5/5] qapi event: clean up in callers
  2014-06-24 23:34 ` [Qemu-devel] [PATCH FOR 2.1 5/5] qapi event: clean up in callers Wenchao Xia
@ 2014-06-25  2:48   ` Eric Blake
  0 siblings, 0 replies; 17+ messages in thread
From: Eric Blake @ 2014-06-25  2:48 UTC (permalink / raw)
  To: Wenchao Xia, qemu-devel; +Cc: pbonzini, armbru, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

On 06/24/2014 05:34 PM, Wenchao Xia wrote:
> This patch improves docs and address small issues in event
> callers.
> 
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  hw/watchdog/watchdog.c   |    2 +-
>  include/block/blockjob.h |    2 +-
>  monitor.c                |    2 +-
>  qapi-schema.json         |    7 ++++---
>  qapi/block-core.json     |    3 ++-
>  qapi/event.json          |    4 ++--
>  6 files changed, 11 insertions(+), 9 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31 Wenchao Xia
@ 2014-06-25 13:13   ` Luiz Capitulino
  2014-06-25 13:15     ` Paolo Bonzini
  0 siblings, 1 reply; 17+ messages in thread
From: Luiz Capitulino @ 2014-06-25 13:13 UTC (permalink / raw)
  To: Wenchao Xia; +Cc: pbonzini, qemu-devel, armbru

On Tue, 24 Jun 2014 16:33:56 -0700
Wenchao Xia <wenchaoqemu@gmail.com> wrote:

> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> On old GLib, the test needs a g_thread_init call.
> 
> Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  tests/test-qmp-event.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
> index cb1e441..17c6444 100644
> --- a/tests/test-qmp-event.c
> +++ b/tests/test-qmp-event.c
> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
>  
>  int main(int argc, char **argv)
>  {
> +    g_thread_init(NULL);
>      qmp_event_set_func_emit(event_test_emit);
>  
>      g_test_init(&argc, &argv, NULL);

This breaks make check on F20:

"""
/home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c: In function ‘main’:
/home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:254:5: error: ‘g_thread_init’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:260) [-Werror=deprecated-declarations]
     g_thread_init(NULL);
     ^
cc1: all warnings being treated as errors
make: *** [tests/test-qmp-event.o] Error 1
"""

I think the best way to fix this is to make util/osdep.c:thread_init()
public (maybe by moving it to include/glib-compat.h) and use that instead.
Also, note that thread_init()'s body is duplicated in a few other places,
so maybe those places should call it too.

You may want to do this in a different series, then I can skip this patch
and apply the rest of the series.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-25 13:13   ` Luiz Capitulino
@ 2014-06-25 13:15     ` Paolo Bonzini
  2014-06-27 18:28       ` Luiz Capitulino
  0 siblings, 1 reply; 17+ messages in thread
From: Paolo Bonzini @ 2014-06-25 13:15 UTC (permalink / raw)
  To: Luiz Capitulino, Wenchao Xia; +Cc: qemu-devel, armbru

Il 25/06/2014 15:13, Luiz Capitulino ha scritto:
> On Tue, 24 Jun 2014 16:33:56 -0700
> Wenchao Xia <wenchaoqemu@gmail.com> wrote:
>
>> From: Paolo Bonzini <pbonzini@redhat.com>
>>
>> On old GLib, the test needs a g_thread_init call.
>>
>> Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
>> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
>> ---
>>  tests/test-qmp-event.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
>> index cb1e441..17c6444 100644
>> --- a/tests/test-qmp-event.c
>> +++ b/tests/test-qmp-event.c
>> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
>>
>>  int main(int argc, char **argv)
>>  {
>> +    g_thread_init(NULL);
>>      qmp_event_set_func_emit(event_test_emit);
>>
>>      g_test_init(&argc, &argv, NULL);
>
> This breaks make check on F20:
>
> """
> /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c: In function ‘main’:
> /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:254:5: error: ‘g_thread_init’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:260) [-Werror=deprecated-declarations]
>      g_thread_init(NULL);
>      ^
> cc1: all warnings being treated as errors
> make: *** [tests/test-qmp-event.o] Error 1
> """
>
> I think the best way to fix this is to make util/osdep.c:thread_init()
> public (maybe by moving it to include/glib-compat.h) and use that instead.
> Also, note that thread_init()'s body is duplicated in a few other places,
> so maybe those places should call it too.
>
> You may want to do this in a different series, then I can skip this patch
> and apply the rest of the series.
>

Thanks Luiz, it's a good suggestion.

Paolo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event
  2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
                   ` (4 preceding siblings ...)
  2014-06-24 23:34 ` [Qemu-devel] [PATCH FOR 2.1 5/5] qapi event: clean up in callers Wenchao Xia
@ 2014-06-25 15:36 ` Luiz Capitulino
  5 siblings, 0 replies; 17+ messages in thread
From: Luiz Capitulino @ 2014-06-25 15:36 UTC (permalink / raw)
  To: Wenchao Xia; +Cc: pbonzini, qemu-devel, armbru

On Tue, 24 Jun 2014 16:33:55 -0700
Wenchao Xia <wenchaoqemu@gmail.com> wrote:

> 
> Paolo Bonzini (1):
>   tests/test-qmp-event: fix for GLib < 2.31
> 
> Wenchao Xia (4):
>   qapi: move event defines
>   qapi: ignore generated event files
>   qapi script: clean up in scripts
>   qapi event: clean up in callers

I've applied patches 2-5, as explained in the other email. Anyone interested
in doing additional review still have time to do so though.

Thanks.

> 
>  .gitignore                              |    1 +
>  Makefile                                |    2 +-
>  docs/qapi-code-gen.txt                  |    8 +-
>  hw/watchdog/watchdog.c                  |    2 +-
>  include/block/blockjob.h                |    2 +-
>  monitor.c                               |    2 +-
>  qapi-event.json                         |  318 -------------------------------
>  qapi-schema.json                        |   12 +-
>  qapi/block-core.json                    |    3 +-
>  qapi/event.json                         |  318 +++++++++++++++++++++++++++++++
>  scripts/qapi-event.py                   |    5 +-
>  scripts/qapi.py                         |    2 +-
>  tests/qapi-schema/event-nest-struct.err |    2 +-
>  tests/test-qmp-event.c                  |    1 +
>  14 files changed, 341 insertions(+), 337 deletions(-)
>  delete mode 100644 qapi-event.json
>  create mode 100644 qapi/event.json
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-25 13:15     ` Paolo Bonzini
@ 2014-06-27 18:28       ` Luiz Capitulino
  2014-06-29 20:31         ` Peter Maydell
  0 siblings, 1 reply; 17+ messages in thread
From: Luiz Capitulino @ 2014-06-27 18:28 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: armbru, Wenchao Xia, qemu-devel

On Wed, 25 Jun 2014 15:15:35 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Il 25/06/2014 15:13, Luiz Capitulino ha scritto:
> > On Tue, 24 Jun 2014 16:33:56 -0700
> > Wenchao Xia <wenchaoqemu@gmail.com> wrote:
> >
> >> From: Paolo Bonzini <pbonzini@redhat.com>
> >>
> >> On old GLib, the test needs a g_thread_init call.
> >>
> >> Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
> >> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> >> ---
> >>  tests/test-qmp-event.c |    1 +
> >>  1 files changed, 1 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
> >> index cb1e441..17c6444 100644
> >> --- a/tests/test-qmp-event.c
> >> +++ b/tests/test-qmp-event.c
> >> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
> >>
> >>  int main(int argc, char **argv)
> >>  {
> >> +    g_thread_init(NULL);
> >>      qmp_event_set_func_emit(event_test_emit);
> >>
> >>      g_test_init(&argc, &argv, NULL);
> >
> > This breaks make check on F20:
> >
> > """
> > /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c: In function ‘main’:
> > /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:254:5: error: ‘g_thread_init’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:260) [-Werror=deprecated-declarations]
> >      g_thread_init(NULL);
> >      ^
> > cc1: all warnings being treated as errors
> > make: *** [tests/test-qmp-event.o] Error 1
> > """
> >
> > I think the best way to fix this is to make util/osdep.c:thread_init()
> > public (maybe by moving it to include/glib-compat.h) and use that instead.
> > Also, note that thread_init()'s body is duplicated in a few other places,
> > so maybe those places should call it too.
> >
> > You may want to do this in a different series, then I can skip this patch
> > and apply the rest of the series.
> >
> 
> Thanks Luiz, it's a good suggestion.

Paolo, Wenchao, are one of one going to work on this?

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-27 18:28       ` Luiz Capitulino
@ 2014-06-29 20:31         ` Peter Maydell
  2014-06-30 10:53           ` Paolo Bonzini
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2014-06-29 20:31 UTC (permalink / raw)
  To: Luiz Capitulino
  Cc: QEMU Developers, Paolo Bonzini, Markus Armbruster, Wenchao Xia

On 27 June 2014 19:28, Luiz Capitulino <lcapitulino@redhat.com> wrote:
> On Wed, 25 Jun 2014 15:15:35 +0200
> Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> Il 25/06/2014 15:13, Luiz Capitulino ha scritto:
>> > On Tue, 24 Jun 2014 16:33:56 -0700
>> > Wenchao Xia <wenchaoqemu@gmail.com> wrote:
>> >
>> >> From: Paolo Bonzini <pbonzini@redhat.com>
>> >>
>> >> On old GLib, the test needs a g_thread_init call.
>> >>
>> >> Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
>> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> >> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
>> >> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
>> >> ---
>> >>  tests/test-qmp-event.c |    1 +
>> >>  1 files changed, 1 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
>> >> index cb1e441..17c6444 100644
>> >> --- a/tests/test-qmp-event.c
>> >> +++ b/tests/test-qmp-event.c
>> >> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
>> >>
>> >>  int main(int argc, char **argv)
>> >>  {
>> >> +    g_thread_init(NULL);
>> >>      qmp_event_set_func_emit(event_test_emit);
>> >>
>> >>      g_test_init(&argc, &argv, NULL);
>> >
>> > This breaks make check on F20:
>> >
>> > """
>> > /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c: In function ‘main’:
>> > /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:254:5: error: ‘g_thread_init’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:260) [-Werror=deprecated-declarations]
>> >      g_thread_init(NULL);
>> >      ^
>> > cc1: all warnings being treated as errors
>> > make: *** [tests/test-qmp-event.o] Error 1
>> > """
>> >
>> > I think the best way to fix this is to make util/osdep.c:thread_init()
>> > public (maybe by moving it to include/glib-compat.h) and use that instead.
>> > Also, note that thread_init()'s body is duplicated in a few other places,
>> > so maybe those places should call it too.
>> >
>> > You may want to do this in a different series, then I can skip this patch
>> > and apply the rest of the series.
>> >
>>
>> Thanks Luiz, it's a good suggestion.
>
> Paolo, Wenchao, are one of one going to work on this?

Ping! Can we have at least a local fix using glib version #ifdefs before
Tuesday please? Otherwise we need to do something like this
to avoid shipping an rc0 which doesn't pass make check on some
systems.

diff --git a/tests/Makefile b/tests/Makefile
index 7e53d0d..a1a0dae 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -27,8 +27,6 @@ check-unit-y += tests/test-string-input-visitor$(EXESUF)
 gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
 check-unit-y += tests/test-string-output-visitor$(EXESUF)
 gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
-check-unit-y += tests/test-qmp-event$(EXESUF)
-gcov-files-test-qmp-event-y += qapi/qmp-event.c
 check-unit-y += tests/test-opts-visitor$(EXESUF)
 gcov-files-test-opts-visitor-y = qapi/opts-visitor.c
 check-unit-y += tests/test-coroutine$(EXESUF)
@@ -213,7 +211,7 @@ test-obj-y = tests/check-qint.o
tests/check-qstring.o tests/check-qdict.o \
        tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
        tests/test-qmp-commands.o tests/test-visitor-serialization.o \
        tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
-       tests/test-opts-visitor.o tests/test-qmp-event.o
+       tests/test-opts-visitor.o

 test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
                   tests/test-qapi-event.o

thanks
-- PMM

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-29 20:31         ` Peter Maydell
@ 2014-06-30 10:53           ` Paolo Bonzini
  2014-07-01 14:32             ` Wenchao Xia
  0 siblings, 1 reply; 17+ messages in thread
From: Paolo Bonzini @ 2014-06-30 10:53 UTC (permalink / raw)
  To: Peter Maydell, Luiz Capitulino
  Cc: QEMU Developers, Wenchao Xia, Markus Armbruster

Il 29/06/2014 22:31, Peter Maydell ha scritto:
> On 27 June 2014 19:28, Luiz Capitulino <lcapitulino@redhat.com> wrote:
>> On Wed, 25 Jun 2014 15:15:35 +0200
>> Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>> Il 25/06/2014 15:13, Luiz Capitulino ha scritto:
>>>> On Tue, 24 Jun 2014 16:33:56 -0700
>>>> Wenchao Xia <wenchaoqemu@gmail.com> wrote:
>>>>
>>>>> From: Paolo Bonzini <pbonzini@redhat.com>
>>>>>
>>>>> On old GLib, the test needs a g_thread_init call.
>>>>>
>>>>> Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
>>>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>>>> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
>>>>> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
>>>>> ---
>>>>>  tests/test-qmp-event.c |    1 +
>>>>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
>>>>> index cb1e441..17c6444 100644
>>>>> --- a/tests/test-qmp-event.c
>>>>> +++ b/tests/test-qmp-event.c
>>>>> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
>>>>>
>>>>>  int main(int argc, char **argv)
>>>>>  {
>>>>> +    g_thread_init(NULL);
>>>>>      qmp_event_set_func_emit(event_test_emit);
>>>>>
>>>>>      g_test_init(&argc, &argv, NULL);
>>>>
>>>> This breaks make check on F20:
>>>>
>>>> """
>>>> /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c: In function ‘main’:
>>>> /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:254:5: error: ‘g_thread_init’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:260) [-Werror=deprecated-declarations]
>>>>      g_thread_init(NULL);
>>>>      ^
>>>> cc1: all warnings being treated as errors
>>>> make: *** [tests/test-qmp-event.o] Error 1
>>>> """
>>>>
>>>> I think the best way to fix this is to make util/osdep.c:thread_init()
>>>> public (maybe by moving it to include/glib-compat.h) and use that instead.
>>>> Also, note that thread_init()'s body is duplicated in a few other places,
>>>> so maybe those places should call it too.
>>>>
>>>> You may want to do this in a different series, then I can skip this patch
>>>> and apply the rest of the series.
>>>>
>>>
>>> Thanks Luiz, it's a good suggestion.
>>
>> Paolo, Wenchao, are one of one going to work on this?
>
> Ping! Can we have at least a local fix using glib version #ifdefs before
> Tuesday please? Otherwise we need to do something like this
> to avoid shipping an rc0 which doesn't pass make check on some
> systems.

I'll send the patch today.  thread_init() is a bit tricky because it is 
a __constructor__ but it is not included in the binary because no other 
function is included from the same file.

BTW, the make check limitation is currently mentioned in the changelog.

Paolo

> diff --git a/tests/Makefile b/tests/Makefile
> index 7e53d0d..a1a0dae 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -27,8 +27,6 @@ check-unit-y += tests/test-string-input-visitor$(EXESUF)
>  gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
>  check-unit-y += tests/test-string-output-visitor$(EXESUF)
>  gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
> -check-unit-y += tests/test-qmp-event$(EXESUF)
> -gcov-files-test-qmp-event-y += qapi/qmp-event.c
>  check-unit-y += tests/test-opts-visitor$(EXESUF)
>  gcov-files-test-opts-visitor-y = qapi/opts-visitor.c
>  check-unit-y += tests/test-coroutine$(EXESUF)
> @@ -213,7 +211,7 @@ test-obj-y = tests/check-qint.o
> tests/check-qstring.o tests/check-qdict.o \
>         tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
>         tests/test-qmp-commands.o tests/test-visitor-serialization.o \
>         tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
> -       tests/test-opts-visitor.o tests/test-qmp-event.o
> +       tests/test-opts-visitor.o
>
>  test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
>                    tests/test-qapi-event.o
>
> thanks
> -- PMM
>
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31
  2014-06-30 10:53           ` Paolo Bonzini
@ 2014-07-01 14:32             ` Wenchao Xia
  0 siblings, 0 replies; 17+ messages in thread
From: Wenchao Xia @ 2014-07-01 14:32 UTC (permalink / raw)
  To: Paolo Bonzini, Peter Maydell, Luiz Capitulino
  Cc: QEMU Developers, Markus Armbruster

于 2014/6/30 18:53, Paolo Bonzini 写道:
> Il 29/06/2014 22:31, Peter Maydell ha scritto:
>> On 27 June 2014 19:28, Luiz Capitulino <lcapitulino@redhat.com> wrote:
>>> On Wed, 25 Jun 2014 15:15:35 +0200
>>> Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>>> Il 25/06/2014 15:13, Luiz Capitulino ha scritto:
>>>>> On Tue, 24 Jun 2014 16:33:56 -0700
>>>>> Wenchao Xia <wenchaoqemu@gmail.com> wrote:
>>>>>
>>>>>> From: Paolo Bonzini <pbonzini@redhat.com>
>>>>>>
>>>>>> On old GLib, the test needs a g_thread_init call.
>>>>>>
>>>>>> Reported-by: Wenchao Xia <wenchaoqemu@gmail.com>
>>>>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>>>>> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com>
>>>>>> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
>>>>>> ---
>>>>>>  tests/test-qmp-event.c |    1 +
>>>>>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>>>>>
>>>>>> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
>>>>>> index cb1e441..17c6444 100644
>>>>>> --- a/tests/test-qmp-event.c
>>>>>> +++ b/tests/test-qmp-event.c
>>>>>> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data,
>>>>>>
>>>>>>  int main(int argc, char **argv)
>>>>>>  {
>>>>>> +    g_thread_init(NULL);
>>>>>>      qmp_event_set_func_emit(event_test_emit);
>>>>>>
>>>>>>      g_test_init(&argc, &argv, NULL);
>>>>>
>>>>> This breaks make check on F20:
>>>>>
>>>>> """
>>>>> /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:
>>>>> In function ‘main’:
>>>>> /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c:254:5:
>>>>> error: ‘g_thread_init’ is deprecated (declared at
>>>>> /usr/include/glib-2.0/glib/deprecated/gthread.h:260)
>>>>> [-Werror=deprecated-declarations]
>>>>>      g_thread_init(NULL);
>>>>>      ^
>>>>> cc1: all warnings being treated as errors
>>>>> make: *** [tests/test-qmp-event.o] Error 1
>>>>> """
>>>>>
>>>>> I think the best way to fix this is to make util/osdep.c:thread_init()
>>>>> public (maybe by moving it to include/glib-compat.h) and use that
>>>>> instead.
>>>>> Also, note that thread_init()'s body is duplicated in a few other
>>>>> places,
>>>>> so maybe those places should call it too.
>>>>>
>>>>> You may want to do this in a different series, then I can skip this
>>>>> patch
>>>>> and apply the rest of the series.
>>>>>
>>>>
>>>> Thanks Luiz, it's a good suggestion.
>>>
>>> Paolo, Wenchao, are one of one going to work on this?
>>
>> Ping! Can we have at least a local fix using glib version #ifdefs before
>> Tuesday please? Otherwise we need to do something like this
>> to avoid shipping an rc0 which doesn't pass make check on some
>> systems.
>
> I'll send the patch today.  thread_init() is a bit tricky because it is
> a __constructor__ but it is not included in the binary because no other
> function is included from the same file.
>
> BTW, the make check limitation is currently mentioned in the changelog.
>
> Paolo
>
   I am not free these days for the issue, thanks for fixing it instead
of me!


>> diff --git a/tests/Makefile b/tests/Makefile
>> index 7e53d0d..a1a0dae 100644
>> --- a/tests/Makefile
>> +++ b/tests/Makefile
>> @@ -27,8 +27,6 @@ check-unit-y +=
>> tests/test-string-input-visitor$(EXESUF)
>>  gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
>>  check-unit-y += tests/test-string-output-visitor$(EXESUF)
>>  gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
>> -check-unit-y += tests/test-qmp-event$(EXESUF)
>> -gcov-files-test-qmp-event-y += qapi/qmp-event.c
>>  check-unit-y += tests/test-opts-visitor$(EXESUF)
>>  gcov-files-test-opts-visitor-y = qapi/opts-visitor.c
>>  check-unit-y += tests/test-coroutine$(EXESUF)
>> @@ -213,7 +211,7 @@ test-obj-y = tests/check-qint.o
>> tests/check-qstring.o tests/check-qdict.o \
>>         tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
>>         tests/test-qmp-commands.o tests/test-visitor-serialization.o \
>>         tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
>> -       tests/test-opts-visitor.o tests/test-qmp-event.o
>> +       tests/test-opts-visitor.o
>>
>>  test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
>>                    tests/test-qapi-event.o
>>
>> thanks
>> -- PMM
>>
>>
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-07-01 14:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-24 23:33 [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Wenchao Xia
2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31 Wenchao Xia
2014-06-25 13:13   ` Luiz Capitulino
2014-06-25 13:15     ` Paolo Bonzini
2014-06-27 18:28       ` Luiz Capitulino
2014-06-29 20:31         ` Peter Maydell
2014-06-30 10:53           ` Paolo Bonzini
2014-07-01 14:32             ` Wenchao Xia
2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 2/5] qapi: move event defines Wenchao Xia
2014-06-25  2:15   ` Eric Blake
2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 3/5] qapi: ignore generated event files Wenchao Xia
2014-06-25  2:20   ` Eric Blake
2014-06-24 23:33 ` [Qemu-devel] [PATCH FOR 2.1 4/5] qapi script: clean up in scripts Wenchao Xia
2014-06-25  2:39   ` Eric Blake
2014-06-24 23:34 ` [Qemu-devel] [PATCH FOR 2.1 5/5] qapi event: clean up in callers Wenchao Xia
2014-06-25  2:48   ` Eric Blake
2014-06-25 15:36 ` [Qemu-devel] [PATCH FOR 2.1 0/5] clean up for qapi event Luiz Capitulino

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.