[v7,06/21] qdev-monitor: well form error hint helpers
diff mbox series

Message ID 20191205152019.8454-7-vsementsov@virtuozzo.com
State New
Headers show
Series
  • error: prepare for auto propagated local_err
Related show

Commit Message

Vladimir Sementsov-Ogievskiy Dec. 5, 2019, 3:20 p.m. UTC
Make qbus_list_bus and qbus_list_dev hint append helpers well formed:
rename errp to errp_in, as it is IN-parameter here (which is unusual
for errp), rename functions to be error_append_*_hint.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 qdev-monitor.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Eric Blake Dec. 5, 2019, 4:58 p.m. UTC | #1
On 12/5/19 9:20 AM, Vladimir Sementsov-Ogievskiy wrote:
> Make qbus_list_bus and qbus_list_dev hint append helpers well formed:
> rename errp to errp_in, as it is IN-parameter here (which is unusual
> for errp), rename functions to be error_append_*_hint.

Commit message mentions a rename...

> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   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)

...but instead you did a type change with the name left unchanged. 
Commit message needs a fix.
Vladimir Sementsov-Ogievskiy Dec. 5, 2019, 5:02 p.m. UTC | #2
05.12.2019 19:58, Eric Blake wrote:
> On 12/5/19 9:20 AM, Vladimir Sementsov-Ogievskiy wrote:
>> Make qbus_list_bus and qbus_list_dev hint append helpers well formed:
>> rename errp to errp_in, as it is IN-parameter here (which is unusual
>> for errp), rename functions to be error_append_*_hint.
> 
> Commit message mentions a rename...
> 
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   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)
> 
> ...but instead you did a type change with the name left unchanged. Commit message needs a fix.
> 

Oops. I blindly take Markus's fixum, and didn't fix commit messages. I'll resend.

Patch
diff mbox series

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;
         }
     }