qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: stefanha@redhat.com, Wenchao Xia <xiawenc@linux.vnet.ibm.com>,
	anthony@codemonkey.ws, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 0/8] Remove stub mon-protocol-event for block
Date: Thu, 12 Sep 2013 16:43:44 +0200	[thread overview]
Message-ID: <5231D320.7050006@redhat.com> (raw)
In-Reply-To: <20130912120853.GI3514@dhcp-200-207.str.redhat.com>

Il 12/09/2013 14:08, Kevin Wolf ha scritto:
> Am 12.09.2013 um 11:31 hat Paolo Bonzini geschrieben:
>> Il 12/09/2013 11:15, Wenchao Xia ha scritto:
>>> This series will remove the usage of symbols of mon-protocol-event in
>>> qemu-img, qemu-nbd and qemu-io, in short remove the connetion for block
>>> layer.
>>>
>>> Background:
>>>   I am tring to decouple block layer code with other unnnessary components,
>>> and in ./stub there many symbols that qemu-img linked as fake implemtion.
>>> As a first step, I am decouple monitor with block layer code, this is the
>>> first part of it.
>>>   There are still other stub symbols for monitor, which will be solved later.
>>> It seems error handlering is also link with those symbols, and will adjust
>>> that.
> 
>> Patches 1-4 look good.  I'm not sure of the advantage of the last four,
>> however.  The ugly part of monitor_protocol_event is not really the
>> stub, but the dependency on QObject.
>>
>> So, in my opinion a more interesting approach would be to describe
>> events using QAPI types.  Generating the events would require a small
>> amount of code to build QObjects manually, because the event syntax
>> doesn't match exactly a QAPI union, but that is only a technical detail.
> 
> You mean the QAPI schema cannot describe events? Why do you think so,
> and wouldn't this be a reason to extend the schema language?
> 
> The QMP spec describes events like this:
> 
> { "event": json-string, "data": json-object,
>   "timestamp": { "seconds": json-number, "microseconds": json-number } }
> 
> Looks like it could be described as:
> 
> { 'type': 'EventTypeA',
>   'data': {
>       'data': {
>           # event-specific data
>       } } }
> { 'type': 'EventBase',
>   'data': { 'event': 'str'. 'timestamp': {
>       'seconds': 'int', 'microseconds': 'int' } }
> { 'union': 'Event',
>   'base:' EventBase',
>   'discriminator': 'event',
>   'data': {
>       'EVENT_NAME_A': 'EventTypeA'
>   } }

I didn't know about all this cool stuff you added. :)

Paolo

  reply	other threads:[~2013-09-12 14:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  9:15 [Qemu-devel] [RFC PATCH 0/8] Remove stub mon-protocol-event for block Wenchao Xia
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 1/8] block: use type MonitorEvent directly Wenchao Xia
2013-09-23 15:53   ` Eric Blake
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 2/8] block: do not include monitor.h in block.c Wenchao Xia
2013-09-23 15:53   ` Eric Blake
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 3/8] qapi: move MonitorEvent define Wenchao Xia
2013-09-23 15:55   ` Eric Blake
2013-09-24 14:05     ` Wenchao Xia
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 4/8] qapi: rename MonitorEvent to QEvent Wenchao Xia
2013-09-23 15:56   ` Eric Blake
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 5/8] block: add a callback layer for common functions Wenchao Xia
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 6/8] block: replace monitor_protocol_event() with callback Wenchao Xia
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 7/8] block: do not include monitor.h Wenchao Xia
2013-09-12  9:15 ` [Qemu-devel] [RFC PATCH 8/8] stubs: remove mon-protocol-event.o in stub obj Wenchao Xia
2013-09-12  9:31 ` [Qemu-devel] [RFC PATCH 0/8] Remove stub mon-protocol-event for block Paolo Bonzini
2013-09-12 12:08   ` Kevin Wolf
2013-09-12 14:43     ` Paolo Bonzini [this message]
2013-09-12 12:44   ` Markus Armbruster
2013-09-16  4:59   ` Wenchao Xia
2013-09-16 10:02     ` Paolo Bonzini
2013-09-17  2:27       ` Wenchao Xia
2013-09-23 19:06         ` Wenchao Xia
2013-09-23  7:52           ` 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=5231D320.7050006@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiawenc@linux.vnet.ibm.com \
    /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).