qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH V2 0/5] add direct support of event in qapi schema
@ 2014-01-02 23:10 Wenchao Xia
  2014-01-02 23:10 ` [Qemu-devel] [RFC PATCH V2 1/5] os-posix: include sys/time.h Wenchao Xia
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: Wenchao Xia @ 2014-01-02 23:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Wenchao Xia, mreitz, armbru, lcapitulino

This series add support for tag/keyword 'event' in qapi-schema.
A new file was created to store some helper functions in patch 2, patch 4 is
the test case, patch 5 is a convert example.

The implemention is done by generate API and a batch of parameters for each
event define, it doesn't generate a struture and visit function in the
background for every event, so it doesn't support nested structure in the
define to avoid trouble. A callback layer is added to control the behavior.
More detail can be found in patch 3's message and incode comments.

Since it is also touching qapi script, it is on top of series:
http://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg03840.html

v2:
  Address Luiz's comments:
  patch 3: rename *err to *local_err, do not initialize *qmp = NULL, create
a new function qmp_build_evet_dict().
  Other change:
  reorgnized script in patch 3, it have a clear three steps, see patch 3's
incode comments.

  Luiz, I have following change a bit different with your comments, please
have a review:
  docs/writing-qmp-commands.txt is still missing, I will add that patch
when this approach get positive feedback.
  Patch 3:
  API name is qapi_event_send_***(), instead of qapi_send_event_***(), to
keep unified api prefix.
  when qapi_event_function.emit == NULL, still return instead of core dump
or error. Before this series, the event function does invalid work silently,
my patch change it to skip invalid work silently. If core dump code is there,
then it still have a silently invalid work as before, since caller will set a
emtpy emit function.
  Some code is still kepted in generated file, see incode comments for those
code.

Wenchao Xia (5):
  1 os-posix: include sys/time.h
  2 qapi: add event helper functions
  3 qapi script: add event support by qapi-event.py
  4 test: add test cases for qapi event
  5 qapi event: convert RTC_CHANGE

 Makefile                                |    9 +-
 Makefile.objs                           |    2 +-
 include/qapi/qmp-event.h                |   22 ++
 include/sysemu/os-posix.h               |    2 +
 monitor.c                               |   14 +
 qapi-schema.json                        |    3 +
 qapi/Makefile.objs                      |    1 +
 qapi/qmp-event.c                        |   56 ++++
 scripts/qapi-event.py                   |  432 +++++++++++++++++++++++++++++++
 tests/Makefile                          |   14 +-
 tests/qapi-schema/qapi-schema-test.json |   12 +
 tests/qapi-schema/qapi-schema-test.out  |   10 +-
 tests/test-qmp-event.c                  |  254 ++++++++++++++++++
 vl.c                                    |    7 +-
 14 files changed, 824 insertions(+), 14 deletions(-)
 create mode 100644 include/qapi/qmp-event.h
 create mode 100644 qapi/qmp-event.c
 create mode 100644 scripts/qapi-event.py
 create mode 100644 tests/test-qmp-event.c

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

end of thread, other threads:[~2014-03-27  7:52 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-02 23:10 [Qemu-devel] [RFC PATCH V2 0/5] add direct support of event in qapi schema Wenchao Xia
2014-01-02 23:10 ` [Qemu-devel] [RFC PATCH V2 1/5] os-posix: include sys/time.h Wenchao Xia
2014-01-02 23:10 ` [Qemu-devel] [RFC PATCH V2 2/5] qapi: add event helper functions Wenchao Xia
2014-01-06 22:23   ` Luiz Capitulino
2014-01-07  2:28     ` Wenchao Xia
2014-03-06 18:26     ` Eric Blake
2014-01-02 23:10 ` [Qemu-devel] [RFC PATCH V2 3/5] qapi script: add event support by qapi-event.py Wenchao Xia
2014-01-06 23:10   ` Luiz Capitulino
2014-01-06 23:17     ` Luiz Capitulino
2014-01-07  3:24       ` Wenchao Xia
2014-02-14  3:26         ` Wenchao Xia
2014-01-07  2:53     ` Wenchao Xia
2014-03-06 18:49   ` Eric Blake
2014-03-19  2:38     ` Wenchao Xia
2014-03-20 22:29       ` Eric Blake
2014-03-24  0:55         ` Wenchao Xia
2014-03-26 12:42           ` Markus Armbruster
2014-03-26 13:13             ` Benoît Canet
2014-03-27  7:52               ` Wenchao Xia
2014-01-02 23:10 ` [Qemu-devel] [RFC PATCH V2 4/5] test: add test cases for qapi event Wenchao Xia
2014-03-06 20:05   ` Eric Blake
2014-01-02 23:10 ` [Qemu-devel] [RFC PATCH V2 5/5] qapi event: convert RTC_CHANGE Wenchao Xia
2014-03-06 20:24   ` Eric Blake
2014-01-06 23:18 ` [Qemu-devel] [RFC PATCH V2 0/5] add direct support of event in qapi schema Luiz Capitulino
2014-03-06 18:14   ` Eric Blake
2014-03-06 19:58     ` Luiz Capitulino
2014-03-07  1:13       ` Wenchao Xia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).