[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 06/21] qdev-monitor: well form error hint helpers
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v8 06/21] qdev-monitor: well form error hint helpers |
Date: |
Thu, 5 Dec 2019 20:46:20 +0300 |
Make qbus_list_bus and qbus_list_dev hint append helpers well formed:
switch errp paramter to Error *const * type, as it has uncommon
behavior: not change the pointer to return error, but operate on
already existent error object.
Rename functions to be error_append_*_hint.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
qdev-monitor.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 29ed73e56a..3465a1e2d0 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -328,7 +328,8 @@ static Object *qdev_get_peripheral_anon(void)
return dev;
}
-static void qbus_list_bus(DeviceState *dev, Error **errp)
+static void qbus_error_append_bus_list_hint(DeviceState *dev,
+ Error *const *errp)
{
BusState *child;
const char *sep = " ";
@@ -342,7 +343,8 @@ static void qbus_list_bus(DeviceState *dev, Error **errp)
error_append_hint(errp, "\n");
}
-static void qbus_list_dev(BusState *bus, Error **errp)
+static void qbus_error_append_dev_list_hint(BusState *bus,
+ Error *const *errp)
{
BusChild *kid;
const char *sep = " ";
@@ -500,7 +502,7 @@ static BusState *qbus_find(const char *path, Error **errp)
if (!dev) {
error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
"Device '%s' not found", elem);
- qbus_list_dev(bus, errp);
+ qbus_error_append_dev_list_hint(bus, errp);
return NULL;
}
@@ -518,7 +520,7 @@ static BusState *qbus_find(const char *path, Error **errp)
if (dev->num_child_bus) {
error_setg(errp, "Device '%s' has multiple child buses",
elem);
- qbus_list_bus(dev, errp);
+ qbus_error_append_bus_list_hint(dev, errp);
} else {
error_setg(errp, "Device '%s' has no child bus", elem);
}
@@ -534,7 +536,7 @@ static BusState *qbus_find(const char *path, Error **errp)
bus = qbus_find_bus(dev, elem);
if (!bus) {
error_setg(errp, "Bus '%s' not found", elem);
- qbus_list_bus(dev, errp);
+ qbus_error_append_bus_list_hint(dev, errp);
return NULL;
}
}
--
2.21.0
- Re: [PATCH v8 08/21] 9pfs: well form error hint helpers, (continued)
- [PATCH v8 15/21] hw/sd: drop extra whitespace in sdhci_sysbus_realize() header, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v8 10/21] block/snapshot: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v8 17/21] hw/usb: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v8 05/21] vnc: drop Error pointer indirection in vnc_client_io_error, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v8 09/21] hw/core/qdev: cleanup Error ** variables, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v8 06/21] qdev-monitor: well form error hint helpers,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v8 18/21] include/qom/object.h: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v8 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error, Vladimir Sementsov-Ogievskiy, 2019/12/05