[Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()

Greg Kurz posted 17 patches 6 years, 1 month ago
Maintainers: Yuval Shaia <yuval.shaia@oracle.com>, Eric Blake <eblake@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, John Snow <jsnow@redhat.com>, Fam Zheng <fam@euphon.net>, Richard Henderson <rth@twiddle.net>, Jeff Cody <codyprime@gmail.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Gerd Hoffmann <kraxel@redhat.com>, Max Reitz <mreitz@redhat.com>, Subbaraya Sundeep <sundeep.lkml@gmail.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eric Farman <farman@linux.ibm.com>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Juan Quintela <quintela@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>
[Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by Greg Kurz 6 years, 1 month ago
Ensure that hints are added even if errp is &error_fatal or &error_abort.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/s390x/s390-ccw.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c
index 0c5a5b60bd6b..9566be800a3b 100644
--- a/hw/s390x/s390-ccw.c
+++ b/hw/s390x/s390-ccw.c
@@ -57,11 +57,13 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev,
 {
     unsigned int cssid, ssid, devid;
     char dev_path[PATH_MAX] = {0}, *tmp;
+    Error *err = NULL;
 
     if (!sysfsdev) {
-        error_setg(errp, "No host device provided");
-        error_append_hint(errp,
+        error_setg(&err, "No host device provided");
+        error_append_hint(&err,
                           "Use -device vfio-ccw,sysfsdev=PATH_TO_DEVICE\n");
+        error_propagate(errp, err);
         return;
     }
 


Re: [Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by Cornelia Huck 6 years, 1 month ago
On Tue, 17 Sep 2019 12:21:34 +0200
Greg Kurz <groug@kaod.org> wrote:

> Ensure that hints are added even if errp is &error_fatal or &error_abort.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  hw/s390x/s390-ccw.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

Can also take this via the s390 tree, let me know what would work best.

Re: [Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by David Hildenbrand 6 years, 1 month ago
On 17.09.19 13:24, Cornelia Huck wrote:
> On Tue, 17 Sep 2019 12:21:34 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
>> Ensure that hints are added even if errp is &error_fatal or &error_abort.
>>
>> Signed-off-by: Greg Kurz <groug@kaod.org>
>> ---
>>  hw/s390x/s390-ccw.c |    6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> 
> Can also take this via the s390 tree, let me know what would work best.
> 

Thanks for fixing the cc list :)

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

Re: [Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by Greg Kurz 6 years, 1 month ago
On Tue, 17 Sep 2019 13:24:12 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> On Tue, 17 Sep 2019 12:21:34 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
> > Ensure that hints are added even if errp is &error_fatal or &error_abort.
> > 
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> >  hw/s390x/s390-ccw.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> 
> Can also take this via the s390 tree, let me know what would work best.

I guess it would be easier to merge if each individual patch goes
through the corresponding sub-maintainer tree. But Eric mentioned
in another mail that the whole whole series could maybe go through
Markus' error tree... so, I don't know which is best. :)

Re: [Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by Cornelia Huck 6 years, 1 month ago
On Tue, 17 Sep 2019 18:36:20 +0200
Greg Kurz <groug@kaod.org> wrote:

> On Tue, 17 Sep 2019 13:24:12 +0200
> Cornelia Huck <cohuck@redhat.com> wrote:
> 
> > On Tue, 17 Sep 2019 12:21:34 +0200
> > Greg Kurz <groug@kaod.org> wrote:
> >   
> > > Ensure that hints are added even if errp is &error_fatal or &error_abort.
> > > 
> > > Signed-off-by: Greg Kurz <groug@kaod.org>
> > > ---
> > >  hw/s390x/s390-ccw.c |    6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)  
> > 
> > Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> > 
> > Can also take this via the s390 tree, let me know what would work best.  
> 
> I guess it would be easier to merge if each individual patch goes
> through the corresponding sub-maintainer tree. But Eric mentioned
> in another mail that the whole whole series could maybe go through
> Markus' error tree... so, I don't know which is best. :)

Ok, it's probably best to take this through the s390 tree, as I plan to
send a pull request tomorrow :)

Thanks, applied.

Re: [Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by Eric Blake 6 years, 1 month ago
On 9/18/19 5:26 AM, Cornelia Huck wrote:
> On Tue, 17 Sep 2019 18:36:20 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
>> On Tue, 17 Sep 2019 13:24:12 +0200
>> Cornelia Huck <cohuck@redhat.com> wrote:
>>
>>> On Tue, 17 Sep 2019 12:21:34 +0200
>>> Greg Kurz <groug@kaod.org> wrote:
>>>   
>>>> Ensure that hints are added even if errp is &error_fatal or &error_abort.
>>>>
>>>> Signed-off-by: Greg Kurz <groug@kaod.org>
>>>> ---
>>>>  hw/s390x/s390-ccw.c |    6 ++++--
>>>>  1 file changed, 4 insertions(+), 2 deletions(-)  
>>>
>>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>>>
>>> Can also take this via the s390 tree, let me know what would work best.  
>>
>> I guess it would be easier to merge if each individual patch goes
>> through the corresponding sub-maintainer tree. But Eric mentioned
>> in another mail that the whole whole series could maybe go through
>> Markus' error tree... so, I don't know which is best. :)
> 
> Ok, it's probably best to take this through the s390 tree, as I plan to
> send a pull request tomorrow :)

If we go with Vladimir's idea of auto-propagation, this change just gets
rewritten again as part of our simplifications to drop all use of
'local_err' in favor of instead using the macro that makes errp always
safe to use locally.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()
Posted by Cornelia Huck 6 years, 1 month ago
On Wed, 18 Sep 2019 12:46:42 -0500
Eric Blake <eblake@redhat.com> wrote:

> On 9/18/19 5:26 AM, Cornelia Huck wrote:
> > On Tue, 17 Sep 2019 18:36:20 +0200
> > Greg Kurz <groug@kaod.org> wrote:
> >   
> >> On Tue, 17 Sep 2019 13:24:12 +0200
> >> Cornelia Huck <cohuck@redhat.com> wrote:
> >>  
> >>> On Tue, 17 Sep 2019 12:21:34 +0200
> >>> Greg Kurz <groug@kaod.org> wrote:
> >>>     
> >>>> Ensure that hints are added even if errp is &error_fatal or &error_abort.
> >>>>
> >>>> Signed-off-by: Greg Kurz <groug@kaod.org>
> >>>> ---
> >>>>  hw/s390x/s390-ccw.c |    6 ++++--
> >>>>  1 file changed, 4 insertions(+), 2 deletions(-)    
> >>>
> >>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> >>>
> >>> Can also take this via the s390 tree, let me know what would work best.    
> >>
> >> I guess it would be easier to merge if each individual patch goes
> >> through the corresponding sub-maintainer tree. But Eric mentioned
> >> in another mail that the whole whole series could maybe go through
> >> Markus' error tree... so, I don't know which is best. :)  
> > 
> > Ok, it's probably best to take this through the s390 tree, as I plan to
> > send a pull request tomorrow :)  
> 
> If we go with Vladimir's idea of auto-propagation, this change just gets
> rewritten again as part of our simplifications to drop all use of
> 'local_err' in favor of instead using the macro that makes errp always
> safe to use locally.
> 

Fair enough. That auto-propagation approach really looks nice, so I'll
go ahead and unqueue this patch again.