[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH V4 0/5] add direct support of event in qapi sche
From: |
Wenchao Xia |
Subject: |
[Qemu-devel] [RFC PATCH V4 0/5] add direct support of event in qapi schema |
Date: |
Thu, 27 Mar 2014 01:03:05 -0700 |
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.
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.
v3:
Address Luiz's comments:
2/5: use -1 when fail to get host timestamp.
3/5: typo fix and better incode comments. all unchanged functions are moved
into qmp-event.c, from generated file. To do so without include issue, 'int'
was used intead of 'enum' in function prototype declaration, since the 'enum'
define is a generated type.
Address Eric's comments:
2/5: use -1 when fail to get host timestamp.
3/5: typo fix, add docs/qapi-code-gen.txt.
4/5: typo fix, verify no other fields in member 'timestamp'.
5/5: add doc in qapi-schema.json.
fix license, all script using GPL2, all C code use LGPL, just as other
similar files in upstream.
v4:
Address Eric's comments:
2/5: typo fix, add copyright declaration, use a static function pointer
instead of a struct in C file, assign -1 in two line of codes to avoid issue
when tv_sec and tv_usec are not in same data width, fix indention.
3/5: typo fix, add copyright declaration.
4/5: add copyright declaration, simplify string compare with
"d->result = g_strcmp0(...) == 0;", add check for tv_usec's range and value.
Other:
3/5: all error check code was moved from qapi-event.py to qapi.py, and it
reports better message with line number info. Added related test case.
Note:
Benoit's series which track input file better seems not the final version,
so I didn't rebase this series ontop for now, will do it once Benoit's ones
get ACKed.
Wenchao Xia (5):
1 os-posix: include sys/time.h
2 qapi: add event helper functions
3 qapi script: add event support
4 test: add test cases for qapi event
5 qapi event: convert RTC_CHANGE
Makefile | 9 +-
Makefile.objs | 2 +-
docs/qapi-code-gen.txt | 18 ++
include/qapi/qmp-event.h | 27 +++
include/sysemu/os-posix.h | 2 +
monitor.c | 15 ++
qapi-schema.json | 13 +
qapi/Makefile.objs | 1 +
qapi/qmp-event.c | 70 ++++++
scripts/qapi-event.py | 366 ++++++++++++++++++++++++++++++
scripts/qapi.py | 12 +
tests/Makefile | 17 +-
tests/qapi-schema/event-nest-struct.err | 1 +
tests/qapi-schema/event-nest-struct.exit | 1 +
tests/qapi-schema/event-nest-struct.json | 2 +
tests/qapi-schema/qapi-schema-test.json | 12 +
tests/qapi-schema/qapi-schema-test.out | 10 +-
tests/test-qmp-event.c | 265 +++++++++++++++++++++
vl.c | 7 +-
19 files changed, 835 insertions(+), 15 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/qapi-schema/event-nest-struct.err
create mode 100644 tests/qapi-schema/event-nest-struct.exit
create mode 100644 tests/qapi-schema/event-nest-struct.json
create mode 100644 tests/qapi-schema/event-nest-struct.out
create mode 100644 tests/test-qmp-event.c
- [Qemu-devel] [RFC PATCH V4 0/5] add direct support of event in qapi schema,
Wenchao Xia <=
- [Qemu-devel] [RFC PATCH V4 1/5] os-posix: include sys/time.h, Wenchao Xia, 2014/03/27
- [Qemu-devel] [RFC PATCH V4 2/5] qapi: add event helper functions, Wenchao Xia, 2014/03/27
- [Qemu-devel] [RFC PATCH V4 3/5] qapi script: add event support, Wenchao Xia, 2014/03/27
- [Qemu-devel] [RFC PATCH V4 4/5] test: add test cases for qapi event, Wenchao Xia, 2014/03/27
- [Qemu-devel] [RFC PATCH V4 5/5] qapi event: convert RTC_CHANGE, Wenchao Xia, 2014/03/27