[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v5 010/126] hw/core/qdev: cleanup Error ** variables
From: |
Eric Blake |
Subject: |
Re: [RFC v5 010/126] hw/core/qdev: cleanup Error ** variables |
Date: |
Fri, 11 Oct 2019 11:52:07 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
On 10/11/19 11:03 AM, Vladimir Sementsov-Ogievskiy wrote:
Rename Error ** parameter in check_only_migratable to common errp.
In device_set_realized:
- Move "if (local_err != NULL)" closer to error setters.
- Drop 'Error **local_errp': it doesn't save any LoCs, but it's very
unusual.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
hw/core/qdev.c | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
@@ -894,27 +893,26 @@ static void device_set_realized(Object *obj, bool value,
Error **errp)
}
} else if (!value && dev->realized) {
- Error **local_errp = NULL;
+ /* We want to catch in local_err only first error */
grammar:
/* We want local_err to track only the first error */
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
- local_errp = local_err ? NULL : &local_err;
object_property_set_bool(OBJECT(bus), false, "realized",
- local_errp);
+ local_err ? NULL : &local_err);
}
Otherwise,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [RFC v5 006/126] qdev-monitor: well form error hint helpers, (continued)
- [RFC v5 006/126] qdev-monitor: well form error hint helpers, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 011/126] block/snapshot: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 004/126] hmp: drop Error pointer indirection in hmp_handle_error, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 009/126] 9pfs: well form error hint helpers, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 008/126] ppc: well form kvmppc_hint_smt_possible error hint helper, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 010/126] hw/core/qdev: cleanup Error ** variables, Vladimir Sementsov-Ogievskiy, 2019/10/11
- Re: [RFC v5 010/126] hw/core/qdev: cleanup Error ** variables,
Eric Blake <=
- [RFC v5 014/126] monitor/qmp-cmds: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 016/126] hw/sd: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 013/126] qga: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 017/126] hw/tpm: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 020/126] include/qom/object.h: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 021/126] qapi/error: add (Error **errp) cleaning APIs, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 027/126] misc: introduce ERRP_AUTO_PROPAGATE, Vladimir Sementsov-Ogievskiy, 2019/10/11