From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy8XH-0005pj-8H for qemu-devel@nongnu.org; Fri, 20 Jun 2014 19:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy8X6-0005CA-GY for qemu-devel@nongnu.org; Fri, 20 Jun 2014 19:47:59 -0400 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:58685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy8X6-0005By-6n for qemu-devel@nongnu.org; Fri, 20 Jun 2014 19:47:48 -0400 Received: by mail-pa0-f48.google.com with SMTP id et14so3628416pad.21 for ; Fri, 20 Jun 2014 16:47:46 -0700 (PDT) Message-ID: <53A4C815.4040003@gmail.com> Date: Sat, 21 Jun 2014 07:47:33 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1403253206-11133-1-git-send-email-imammedo@redhat.com> <53A45753.6090505@redhat.com> In-Reply-To: <53A45753.6090505@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Igor Mammedov , qemu-devel@nongnu.org Cc: mst@redhat.com 于 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 >> --- >> 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 >> +## >> +{ '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. We can improve it later. > If you add the Since line, > Reviewed-by: Eric Blake >