Message ID | 1446020161-21758-1-git-send-email-armbru@redhat.com |
---|---|
State | New |
Headers | show |
On 28 October 2015 at 08:15, Markus Armbruster <armbru@redhat.com> wrote: > The following changes since commit 7e038b94e74e1c2d1b3598e2e4b0b5c8b79a7278: > > Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-10-27 10:10:46 +0000) > > are available in the git repository at: > > git://repo.or.cz/qemu/armbru.git tags/pull-monitor-2015-10-28 > > for you to fetch changes up to 81387a94e3a95068b45d15a4db67f3942c46ad4e: > > docs: Document QMP event rate limiting (2015-10-28 09:07:48 +0100) > > ---------------------------------------------------------------- > QMP and QObject patches > > ---------------------------------------------------------------- > Markus Armbruster (14): > qobject: Drop QObject_HEAD > qbool: Make conversion from QObject * accept null > qdict: Make conversion from QObject * accept null > qfloat qint: Make conversion from QObject * accept null > qlist: Make conversion from QObject * accept null > qstring: Make conversion from QObject * accept null > monitor: Reduce casting of QAPI event QDict > monitor: Simplify event throttling > monitor: Switch from timer_new() to timer_new_ns() > monitor: Split MonitorQAPIEventConf off MonitorQAPIEventState > glib: add compatibility interface for g_hash_table_add() > monitor: Turn monitor_qapi_event_state[] into a hash table > monitor: Throttle event VSERPORT_CHANGE separately by "id" > docs: Document QMP event rate limiting OSX build failure :-( CC qga/commands-posix.o In file included from /Users/pm215/src/qemu-for-merges/qga/main.c:25: In file included from /Users/pm215/src/qemu-for-merges/include/qapi/qmp/json-parser.h:17: In file included from /Users/pm215/src/qemu-for-merges/include/qemu-common.h:25: /Users/pm215/src/qemu-for-merges/include/glib-compat.h:171:12: error: returning 'void' from a function with incompatible result type 'gboolean' (aka 'int') return g_hash_table_replace(hash_table, key, key) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Looks like g_hash_table_replace was originally a 'void' return and switched to 'gboolean' return at some later date: https://github.com/GNOME/glib/commit/910191597a6c2e5d5d460e9ce9efb4f47d9cc63c thanks -- PMM
On 10/28/2015 09:07 AM, Peter Maydell wrote: >> glib: add compatibility interface for g_hash_table_add() >> monitor: Turn monitor_qapi_event_state[] into a hash table > > CC qga/commands-posix.o > In file included from /Users/pm215/src/qemu-for-merges/qga/main.c:25: > In file included from > /Users/pm215/src/qemu-for-merges/include/qapi/qmp/json-parser.h:17: > In file included from /Users/pm215/src/qemu-for-merges/include/qemu-common.h:25: > /Users/pm215/src/qemu-for-merges/include/glib-compat.h:171:12: error: > returning 'void' from a function with incompatible result type > 'gboolean' (aka 'int') > return g_hash_table_replace(hash_table, key, key) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Looks like g_hash_table_replace was originally a 'void' return > and switched to 'gboolean' return at some later date: > > https://github.com/GNOME/glib/commit/910191597a6c2e5d5d460e9ce9efb4f47d9cc63c This patch series isn't using the return value of g_hash_table_add, so our glib replacement could be changed to return void. On the other hand, would it be better to proactively retrofit the return type into ALL of the g_hash_table_* functions that were swapped to return a value, so that future uses of the functions with qemu can make use of the modern contract, even though this series doesn't use it?
Eric Blake <eblake@redhat.com> writes: > On 10/28/2015 09:07 AM, Peter Maydell wrote: > >>> glib: add compatibility interface for g_hash_table_add() >>> monitor: Turn monitor_qapi_event_state[] into a hash table > >> >> CC qga/commands-posix.o >> In file included from /Users/pm215/src/qemu-for-merges/qga/main.c:25: >> In file included from >> /Users/pm215/src/qemu-for-merges/include/qapi/qmp/json-parser.h:17: >> In file included from /Users/pm215/src/qemu-for-merges/include/qemu-common.h:25: >> /Users/pm215/src/qemu-for-merges/include/glib-compat.h:171:12: error: >> returning 'void' from a function with incompatible result type >> 'gboolean' (aka 'int') >> return g_hash_table_replace(hash_table, key, key) >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Looks like g_hash_table_replace was originally a 'void' return >> and switched to 'gboolean' return at some later date: >> >> https://github.com/GNOME/glib/commit/910191597a6c2e5d5d460e9ce9efb4f47d9cc63c The 80s are calling: cavalier API break. The GLib maintainers should know better. Anyway, this change is in 2.39.2. The replacement function is for <2.32. Therefore, g_hash_table_replace() will always return void then. > This patch series isn't using the return value of g_hash_table_add, so > our glib replacement could be changed to return void. Yes. Matches GLib's function before 2.39.2. > On the other hand, would it be better to proactively retrofit the return > type into ALL of the g_hash_table_* functions that were swapped to > return a value, so that future uses of the functions with qemu can make > use of the modern contract, even though this series doesn't use it? I think we should add glib-compat cruft only when we actually need it.