Received: from eggs.gnu.org ([208.118.235.92]:49348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYir-0006Vp-Ow for qemu-devel@nongnu.org; Thu, 24 May 2012 10:09:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXYih-0004a8-Dp for qemu-devel@nongnu.org; Thu, 24 May 2012 10:09:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYih-0004Zh-6x for qemu-devel@nongnu.org; Thu, 24 May 2012 10:08:51 -0400 From: Markus Armbruster References: <1337859784-24097-1-git-send-email-armbru@redhat.com> <4FBE2A59.3060701@suse.de> Date: Thu, 24 May 2012 16:08:46 +0200 In-Reply-To: <4FBE2A59.3060701@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22?= =?utf-8?Q?'s?= message of "Thu, 24 May 2012 14:32:25 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws Andreas F=C3=A4rber writes: > 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. How does returning a TypeImpl * open up TypeImpl any more than type_register() already does? > I ran into a > similar error-catching scenario where I needed to check for class > existence in some qdev_try_* function. If this is a really common pattern, and object_try_new() really saves code, why not. Can't see why we need the Error **argument, though. What kinds of different errors that do you envisage? Where "different" means "actual callers care about the difference". > And there were still too many > asserts in the QOM core for my taste. > > The QMP command itself looks good to me. Thanks!