From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXXkP-0008NR-E8 for qemu-devel@nongnu.org; Thu, 24 May 2012 09:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXXkG-0002jl-G8 for qemu-devel@nongnu.org; Thu, 24 May 2012 09:06:33 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:43493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXXkG-0002jQ-Bt for qemu-devel@nongnu.org; Thu, 24 May 2012 09:06:24 -0400 Received: by yhoo21 with SMTP id o21so9512730yho.4 for ; Thu, 24 May 2012 06:06:22 -0700 (PDT) Message-ID: <4FBE324C.70407@codemonkey.ws> Date: Thu, 24 May 2012 08:06:20 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1337859784-24097-1-git-send-email-armbru@redhat.com> <4FBE2A59.3060701@suse.de> In-Reply-To: <4FBE2A59.3060701@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH RFC 0/2] QMP command qom-new List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: pbonzini@redhat.com, Markus Armbruster , qemu-devel@nongnu.org On 05/24/2012 07:32 AM, Andreas Färber wrote: > Am 24.05.2012 13:43, schrieb Markus Armbruster: >> Beware: second patch is the product of voodoo-coding. > > Hm, I don't like the voodoo. ;) I would rather expose a proper C API > like object_try_new(const char *, Error **) than opening up the TypeImpl > internals to the public and hand-coding it everywhere. I ran into a > similar error-catching scenario where I needed to check for class > existence in some qdev_try_* function. There are very few places where errors can be handled gracefully. They are exceptions and can be treated as such. I think it's far better for the QOM infrastructure to assert when it detects something bad because 99% of the users of QOM do not even attempt to handle errors gracefully. Regards, Anthony Liguori And there were still too many > asserts in the QOM core for my taste. > > The QMP command itself looks good to me. > > Andreas > >> Markus Armbruster (2): >> qom: Give type_get_by_name() external linkage >> qmp: New command qom-new >> >> include/qemu/object.h | 8 ++++++++ >> qapi-schema.json | 22 ++++++++++++++++++++++ >> qmp-commands.hx | 5 +++++ >> qmp.c | 27 +++++++++++++++++++++++++++ >> qom/object.c | 2 +- >> 5 files changed, 63 insertions(+), 1 deletions(-) >