All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH RFC 2/3] qapi script: add support of event
Date: Mon, 02 Dec 2013 14:48:01 +0800	[thread overview]
Message-ID: <529C2D21.80502@linux.vnet.ibm.com> (raw)
In-Reply-To: <20131128093135.2ef9e21f@redhat.com>


>>
>>>> +
>>>> +    if (!qapi_event_functions.emit) {
>>>
>>> Better to return an error here instead of silently failing.
>>>
>>
>>     The purpose is allowing emit=NULL and skip event code in that case.
>
> But the code will do nothing and the caller won't know that.
>
   Now the caller also won't know that useless code will be executed,
when qemu-img link with stub of monitor_event functions. :)

> Actually, I wonder if the code should even abort() in such a case,
> as emit=NULL would be a programming today.
>

   I am not sure why the code should always do something. The code may
actually take CPU resource to do nothing meanful, such as build up a
qdict and release it later, when emit is not a valid function. So I
did this as an improvement: check emit function ahead to escape useless
work.

  reply	other threads:[~2013-12-02  6:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13  1:44 [Qemu-devel] [PATCH RFC 0/3] add direct support of event in qapi schema Wenchao Xia
2013-11-13  1:44 ` [Qemu-devel] [PATCH RFC 1/3] os-posix: include sys/time.h Wenchao Xia
2013-12-13 13:26   ` Eric Blake
2013-11-13  1:44 ` [Qemu-devel] [PATCH RFC 2/3] qapi script: add support of event Wenchao Xia
2013-11-28  0:48   ` Luiz Capitulino
2013-11-28  7:16     ` Wenchao Xia
2013-11-28 14:31       ` Luiz Capitulino
2013-12-02  6:48         ` Wenchao Xia [this message]
2013-12-13  3:00           ` Wenchao Xia
2013-12-13 13:31   ` Eric Blake
2013-12-13 13:43     ` Kevin Wolf
2013-12-16  2:50       ` Wenchao Xia
2013-12-16  9:04         ` Markus Armbruster
2013-12-16  9:13       ` Markus Armbruster
2014-01-07 12:14         ` Markus Armbruster
2014-01-13 10:08           ` Markus Armbruster
2014-01-15  1:47             ` Wenchao Xia
2014-01-16  2:50         ` Michael Roth
2014-01-16 11:05           ` Paolo Bonzini
2014-01-30 10:35             ` Markus Armbruster
2013-12-16  2:51     ` Wenchao Xia
2013-11-13  1:44 ` [Qemu-devel] [PATCH 2/2] try Wenchao Xia
2013-11-13  1:47   ` Wenchao Xia
2013-11-13  1:44 ` [Qemu-devel] [PATCH RFC 3/3] tests: add test cases for qapi event support Wenchao Xia
2013-12-13 13:36   ` Eric Blake
2013-12-16  2:55     ` Wenchao Xia
2013-12-16  3:12       ` Wenchao Xia
2014-01-02  2:30         ` Wenchao Xia
2013-11-22  2:03 ` [Qemu-devel] [PATCH RFC 0/3] add direct support of event in qapi schema Wenchao Xia
2013-11-22 14:33   ` Luiz Capitulino

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=529C2D21.80502@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.