Message ID | 156871569396.196432.12307975838741351907.stgit@bahia.lan |
---|---|
State | New |
Headers | show |
Series | Fix usage of error_append_hint() | expand |
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.
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>
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. :)
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.
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.
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.
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; }
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(-)