qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH V2 0/5] add direct support of event in qapi sche


From: Wenchao Xia
Subject: [Qemu-devel] [RFC PATCH V2 0/5] add direct support of event in qapi schema
Date: Fri, 3 Jan 2014 07:10:29 +0800

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]