|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH RFC 0/2] QMP command qom-new |
Date: | Thu, 24 May 2012 08:06:20 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
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. AndreasMarkus 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(-)
[Prev in Thread] | Current Thread | [Next in Thread] |