Wenchao Xia <wenchaoq...@gmail.com> writes: > 于 2014/6/20 23:46, Eric Blake 写道: >> On 06/20/2014 02:33 AM, Igor Mammedov wrote: >>> emits event when ACPI OSPM evaluates _OST method >>> of ACPI device. >>> >>> Signed-off-by: Igor Mammedov <imamm...@redhat.com> >>> --- >>> v2: >>> - use new QAPI event infrastructure >>> from rebased PCI tree on top of today's QMP pull request >>> --- >>> hw/acpi/memory_hotplug.c | 7 ++++++- >>> qapi-event.json | 10 ++++++++++ >>> 2 files changed, 16 insertions(+), 1 deletions(-) >>> >> >>> +++ b/qapi-event.json >>> @@ -304,3 +304,13 @@ >>> { 'event': 'QUORUM_REPORT_BAD', >>> 'data': { '*error': 'str', 'node-name': 'str', >>> 'sector-num': 'int', 'sector-count': 'int' } } >>> + >>> +## >>> +# @ACPI_DEVICE_OST >>> +# >>> +# Emitted when guest executes ACPI _OST method. >>> +# >>> +# @info: ACPIOSTInfo type as described in qapi-schema.json >> >> Needs 'Since: 2.1'. >> > With above added, > Reviewed-by: Wenchao Xia <wenchaoq...@gmail.com> > >>> +## >>> +{ 'event': 'ACPI_DEVICE_OST', >>> + 'data': { 'info': 'ACPIOSTInfo' } } >>> >> >> Not your fault, as the problem already exists, but it's a bit awkward >> that qapi-event.json is not self-contained, and your patch is only >> making it worse. qapi-event.json only makes sense when included by >> qapi-schema.json, when ideally it would be nice if it made sense if >> compiled in isolation. I already pointed this fact out on Wenchao's >> series that made events part of QAPI, but fixing it first requires >> teaching the code generators to flag places where a type is used without > > > >> a pre-definition, so that we know which types have to be moved into a >> common include. So don't let this comment hold up your patch. >> > I think two issues should be addressed: > 1 don't let generator guess the type if define is not found. > 2 Support duplicated include, that is: > > qapi/types.json > | > --------------------------- > | | > qapi/qapi-event.json qapi/block.json > | | > qapi-schema-json > > Making sure above include doesn't generate two copy of types from > qapi/types.json.
See Benoît's commit 24fd848 "qapi: skip redundant includes". > We can improve it later. > >> If you add the Since line, >> Reviewed-by: Eric Blake <ebl...@redhat.com>