qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 0/2] QMP command qom-new


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH RFC 0/2] QMP command qom-new
Date: Thu, 24 May 2012 16:08:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Andreas Färber <address@hidden> 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!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]