qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <wenchaoqemu@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: lcapitulino@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema
Date: Sun, 15 Jun 2014 08:52:18 +0800	[thread overview]
Message-ID: <539CEE42.5090906@gmail.com> (raw)
In-Reply-To: <53969C25.7010705@redhat.com>

于 2014/6/10 13:48, Paolo Bonzini 写道:
> Il 05/06/2014 14:21, Wenchao Xia ha scritto:
>> 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.
>>
>> v5:
>>   Address Eric and Markus's comments:
>>   2/28: use uint64_t for both sec and usec, to avoid type cast issue
>> in printf.
>>   Other:
>>   Remove RFC, add full coversion by patch 5-28.
>>   3/28: add prefix for event enum type name, to avoid double define of
>> QAPIEvent in test code.
>>
>> v6:
>>   Address Eric's comments:
>>   3/29: employ modularization mechnism of schema file of Lluís
>> series, remove
>> error_is_set() usage.
>>   4/29: Makefile change for Lluís series.
>>   5/29: separate patch for refactoring the existing schema defines,
>> improve doc
>> for @service in VncBasicInfo.
>>   7/29-28/29: define and convert event caller one by one.
>>   Other change:
>>   6/29: new way to add event emit implemention. In v5 it breaks old event
>> mechnism, in v6 it touch nothing of old event mechnism but add a new
>> set of
>> functions for new event mechnism.
>>   7/29: Add new file qapi-event.json to store event defines, and all type
>> defines goes into qapi-schema.json.
>>   29/29: related clean up change.
>>   Note:
>>   I have no way to verify target-s390x/kvm.c touched by patch 27/29, and
>> block/quorum.c touched by patch 28/29, need a confirm from whom has
>> the test
>> env.
>>
>> Wenchao Xia (29):
>>   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: adjust existing defines
>>   6 monitor: add an implemention as qapi event emit method
>>   7 qapi: add new schema file qapi-event.json
>>   8 qapi event: convert SHUTDOWN
>>   9 qapi event: convert POWERDOWN
>>   10 qapi event: convert RESET
>>   11 qapi event: convert STOP
>>   12 qapi event: convert RESUME
>>   13 qapi event: convert SUSPEND
>>   14 qapi event: convert SUSPEND_DISK
>>   15 qapi event: convert WAKEUP
>>   16 qapi event: convert RTC_CHANGE
>>   17 qapi event: convert WATCHDOG
>>   18 qapi event: convert DEVICE_DELETED
>>   19 qapi event: convert DEVICE_TRAY_MOVED
>>   20 qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR
>>   21 qapi event: convert BLOCK_IMAGE_CORRUPTED
>>   22 qapi event: convert other BLOCK_JOB events
>>   23 qapi event: convert NIC_RX_FILTER_CHANGED
>>   24 qapi event: convert VNC events
>>   25 qapi event: convert SPICE events
>>   26 qapi event: convert BALLOON_CHANGE
>>   27 qapi event: convert GUEST_PANICKED
>>   28 qapi event: convert QUORUM events
>>   29 qapi event: clean up
>>
>>  Makefile                                 |   21 +-
>>  Makefile.objs                            |    2 +-
>>  balloon.c                                |   13 -
>>  block.c                                  |   68 +---
>>  block/backup.c                           |    2 +-
>>  block/mirror.c                           |    9 +-
>>  block/qcow2-refcount.c                   |   14 +-
>>  block/quorum.c                           |   25 +-
>>  block/stream.c                           |    4 +-
>>  blockdev.c                               |   12 +-
>>  blockjob.c                               |   53 ++--
>>  cpus.c                                   |    5 +-
>>  docs/qapi-code-gen.txt                   |   18 +
>>  docs/qmp/qmp-events.txt                  |  541
>> ------------------------------
>>  hmp.c                                    |    5 +-
>>  hw/acpi/core.c                           |    4 +-
>>  hw/block/virtio-blk.c                    |    6 +-
>>  hw/core/qdev.c                           |   12 +-
>>  hw/ide/core.c                            |    6 +-
>>  hw/misc/pvpanic.c                        |   13 +-
>>  hw/net/virtio-net.c                      |   13 +-
>>  hw/ppc/spapr_rtas.c                      |    3 +-
>>  hw/scsi/scsi-disk.c                      |    6 +-
>>  hw/timer/mc146818rtc.c                   |    3 +-
>>  hw/virtio/virtio-balloon.c               |    6 +-
>>  hw/watchdog/watchdog.c                   |   23 +-
>>  include/block/block.h                    |    4 -
>>  include/block/block_int.h                |    3 -
>>  include/block/blockjob.h                 |   17 +-
>>  include/monitor/monitor.h                |   40 ---
>>  include/qapi/qmp-event.h                 |   27 ++
>>  include/qemu/sockets.h                   |    3 +-
>>  include/sysemu/balloon.h                 |    2 -
>>  include/sysemu/os-posix.h                |    2 +
>>  include/sysemu/sysemu.h                  |    2 -
>>  monitor.c                                |  185 +++--------
>>  qapi-event.json                          |  452
>> +++++++++++++++++++++++++
>>  qapi-schema.json                         |  178 +++++++++--
>>  qapi/Makefile.objs                       |    1 +
>>  qapi/qmp-event.c                         |   74 ++++
>>  scripts/qapi-event.py                    |  369 ++++++++++++++++++++
>>  scripts/qapi.py                          |   12 +
>>  stubs/Makefile.objs                      |    1 -
>>  stubs/mon-protocol-event.c               |    6 -
>>  target-s390x/kvm.c                       |    8 +-
>>  tests/Makefile                           |   18 +-
>>  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 +++++++++++++++
>>  trace-events                             |    4 +
>>  ui/spice-core.c                          |   77 +++--
>>  ui/vnc.c                                 |  120 ++++----
>>  ui/vnc.h                                 |    4 +-
>>  util/qemu-sockets.c                      |   10 +-
>>  vl.c                                     |   22 +-
>>  58 files changed, 1732 insertions(+), 1087 deletions(-)
>>  delete mode 100644 docs/qmp/qmp-events.txt
>>  create mode 100644 include/qapi/qmp-event.h
>>  create mode 100644 qapi-event.json
>>  create mode 100644 qapi/qmp-event.c
>>  create mode 100644 scripts/qapi-event.py
>>  delete mode 100644 stubs/mon-protocol-event.c
>>  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
>>
>>
>>
>
> Tested-by: Paolo Bonzini <pbonzini@redhat.com>
>
> Unfortunately, this already does not apply anymore.
>
> I've placed the rebase on branch qapi-event of my github repository. The
> resolutions are trivial, so perhaps Luiz or Michael can pull from there?
>
> Paolo


   Thanks for testing my work:)
   Eric:
   I have looked the comments, most fix will arrive in my V7 next week,
but still I have two issues without decision:
   1. Whether to use QAPIEvent in callback function type declartion,
See my feedback in 6/29.
   2. Whether to make qapi-event.json self sufficent, see my comments
in 17/29.

  reply	other threads:[~2014-06-15  0:52 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 12:21 [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 01/29] os-posix: include sys/time.h Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 02/29] qapi: add event helper functions Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 03/29] qapi script: add event support Wenchao Xia
2014-06-13 16:47   ` Eric Blake
2014-06-13 21:28   ` Eric Blake
2014-06-18  3:33   ` Eric Blake
2014-06-18  6:06     ` Paolo Bonzini
2014-06-18 22:45       ` Wenchao Xia
2014-06-18  3:50   ` Eric Blake
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 04/29] test: add test cases for qapi event Wenchao Xia
2014-06-13 17:05   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 05/29] qapi: adjust existing defines Wenchao Xia
2014-06-13 17:32   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 06/29] monitor: add an implemention as qapi event emit method Wenchao Xia
2014-06-13 19:04   ` Eric Blake
2014-06-15  0:27     ` Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 07/29] qapi: add new schema file qapi-event.json Wenchao Xia
2014-06-13 19:25   ` Eric Blake
2014-06-13 19:45     ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 08/29] qapi event: convert SHUTDOWN Wenchao Xia
2014-06-13 19:57   ` Eric Blake
2014-06-15  0:32     ` Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 09/29] qapi event: convert POWERDOWN Wenchao Xia
2014-06-13 20:02   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 10/29] qapi event: convert RESET Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 11/29] qapi event: convert STOP Wenchao Xia
2014-06-13 20:29   ` Eric Blake
2014-06-17  9:17     ` Paolo Bonzini
2014-06-17 13:18       ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 12/29] qapi event: convert RESUME Wenchao Xia
2014-06-13 20:33   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 13/29] qapi event: convert SUSPEND Wenchao Xia
2014-06-13 20:40   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 14/29] qapi event: convert SUSPEND_DISK Wenchao Xia
2014-06-13 20:42   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 15/29] qapi event: convert WAKEUP Wenchao Xia
2014-06-13 20:57   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 16/29] qapi event: convert RTC_CHANGE Wenchao Xia
2014-06-13 21:27   ` Eric Blake
2014-06-15  0:38     ` Wenchao Xia
2014-06-15 14:01       ` Paolo Bonzini
2014-06-15 14:00     ` Paolo Bonzini
2014-06-17  9:21     ` Paolo Bonzini
2014-06-17 13:19       ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 17/29] qapi event: convert WATCHDOG Wenchao Xia
2014-06-13 21:47   ` Eric Blake
2014-06-13 22:05     ` Eric Blake
2014-06-15  0:45       ` Wenchao Xia
2014-06-17  9:23     ` Paolo Bonzini
2014-06-17 13:21       ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 18/29] qapi event: convert DEVICE_DELETED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 19/29] qapi event: convert DEVICE_TRAY_MOVED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 20/29] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 21/29] qapi event: convert BLOCK_IMAGE_CORRUPTED Wenchao Xia
2014-06-16 22:53   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 22/29] qapi event: convert other BLOCK_JOB events Wenchao Xia
2014-06-16 22:57   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 23/29] qapi event: convert NIC_RX_FILTER_CHANGED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 24/29] qapi event: convert VNC events Wenchao Xia
2014-06-16 23:01   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 25/29] qapi event: convert SPICE events Wenchao Xia
2014-06-16 23:05   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 26/29] qapi event: convert BALLOON_CHANGE Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 27/29] qapi event: convert GUEST_PANICKED Wenchao Xia
2014-06-16 14:08   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 28/29] qapi event: convert QUORUM events Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 29/29] qapi event: clean up Wenchao Xia
2014-06-16 14:09   ` Eric Blake
2014-06-10  5:48 ` [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema Paolo Bonzini
2014-06-15  0:52   ` Wenchao Xia [this message]
2014-06-17 10:57     ` Paolo Bonzini
2014-06-17 16:05       ` Eric Blake
2014-06-17 16:30         ` Paolo Bonzini
2014-06-17 22:10           ` Wenchao Xia
2014-06-18  4:00       ` Eric Blake
2014-06-18  6:07         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=539CEE42.5090906@gmail.com \
    --to=wenchaoqemu@gmail.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).