* [PATCH] disk/pata: Suppress error message "no device connected"
@ 2021-03-01 19:36 Glenn Washburn
2021-03-03 6:23 ` Paul Menzel
0 siblings, 1 reply; 3+ messages in thread
From: Glenn Washburn @ 2021-03-01 19:36 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Glenn Washburn
This error message comes from the grub_print_error in
grub_pata_device_initialize, which does not pass on the error, and is
raised in check_device. The function check_device needs to return this as
an error because check_device is also used in grub_pata_open, which does
pass on this error to indicate that the device can not be used.
This is actually not an error when displayed by grub_pata_device_initialize
because it just indicates that there are no pata devices seen. This may be
confusing to end users who do not have pata devices yet are loading the
pata module (perhaps implicitly via nativedisk). This also causes unnessary
output which may need to be accounted for in functional testing.
Instead print to the debug log when check_device raises this "error" and pop
the error from the error stack. If there is another error on the stack then
print the error stack as those should be real errors.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/disk/pata.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/grub-core/disk/pata.c b/grub-core/disk/pata.c
index 23eef2be1..b15aeaa13 100644
--- a/grub-core/disk/pata.c
+++ b/grub-core/disk/pata.c
@@ -331,6 +331,12 @@ grub_pata_device_initialize (int port, int device, int addr)
*devp = dev;
err = check_device (dev);
+ if (err == GRUB_ERR_UNKNOWN_DEVICE)
+ {
+ grub_dprintf ("pata", "%s\n", grub_errmsg);
+ grub_error_pop();
+ }
+
if (err)
grub_print_error ();
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] disk/pata: Suppress error message "no device connected"
2021-03-01 19:36 [PATCH] disk/pata: Suppress error message "no device connected" Glenn Washburn
@ 2021-03-03 6:23 ` Paul Menzel
2021-03-03 17:05 ` Daniel Kiper
0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2021-03-03 6:23 UTC (permalink / raw)
To: Glenn Washburn; +Cc: The development of GNU GRUB, Daniel Kiper
Dear Glenn,
Am 01.03.21 um 20:36 schrieb Glenn Washburn:
> This error message comes from the grub_print_error in
> grub_pata_device_initialize, which does not pass on the error, and is
> raised in check_device. The function check_device needs to return this as
> an error because check_device is also used in grub_pata_open, which does
> pass on this error to indicate that the device can not be used.
>
> This is actually not an error when displayed by grub_pata_device_initialize
> because it just indicates that there are no pata devices seen. This may be
> confusing to end users who do not have pata devices yet are loading the
> pata module (perhaps implicitly via nativedisk). This also causes unnessary
> output which may need to be accounted for in functional testing.
>
> Instead print to the debug log when check_device raises this "error" and pop
> the error from the error stack. If there is another error on the stack then
> print the error stack as those should be real errors.
>
> Signed-off-by: Glenn Washburn <development@efficientek.com>
> ---
> grub-core/disk/pata.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/grub-core/disk/pata.c b/grub-core/disk/pata.c
> index 23eef2be1..b15aeaa13 100644
> --- a/grub-core/disk/pata.c
> +++ b/grub-core/disk/pata.c
> @@ -331,6 +331,12 @@ grub_pata_device_initialize (int port, int device, int addr)
> *devp = dev;
>
> err = check_device (dev);
> + if (err == GRUB_ERR_UNKNOWN_DEVICE)
> + {
> + grub_dprintf ("pata", "%s\n", grub_errmsg);
> + grub_error_pop();
> + }
> +
(The indentation looks wrong in Mozilla Thunderbird, but applying the
patch, everything is fine. The non-changed lines are indented by two
spaces too much.)
> if (err)
> grub_print_error ();
Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] disk/pata: Suppress error message "no device connected"
2021-03-03 6:23 ` Paul Menzel
@ 2021-03-03 17:05 ` Daniel Kiper
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2021-03-03 17:05 UTC (permalink / raw)
To: Paul Menzel; +Cc: Glenn Washburn, The development of GNU GRUB
On Wed, Mar 03, 2021 at 07:23:40AM +0100, Paul Menzel wrote:
> Dear Glenn,
>
> Am 01.03.21 um 20:36 schrieb Glenn Washburn:
> > This error message comes from the grub_print_error in
> > grub_pata_device_initialize, which does not pass on the error, and is
> > raised in check_device. The function check_device needs to return this as
> > an error because check_device is also used in grub_pata_open, which does
> > pass on this error to indicate that the device can not be used.
> >
> > This is actually not an error when displayed by grub_pata_device_initialize
> > because it just indicates that there are no pata devices seen. This may be
> > confusing to end users who do not have pata devices yet are loading the
> > pata module (perhaps implicitly via nativedisk). This also causes unnessary
> > output which may need to be accounted for in functional testing.
> >
> > Instead print to the debug log when check_device raises this "error" and pop
> > the error from the error stack. If there is another error on the stack then
> > print the error stack as those should be real errors.
> >
> > Signed-off-by: Glenn Washburn <development@efficientek.com>
> > ---
> > grub-core/disk/pata.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/grub-core/disk/pata.c b/grub-core/disk/pata.c
> > index 23eef2be1..b15aeaa13 100644
> > --- a/grub-core/disk/pata.c
> > +++ b/grub-core/disk/pata.c
> > @@ -331,6 +331,12 @@ grub_pata_device_initialize (int port, int device, int addr)
> > *devp = dev;
> > err = check_device (dev);
> > + if (err == GRUB_ERR_UNKNOWN_DEVICE)
> > + {
> > + grub_dprintf ("pata", "%s\n", grub_errmsg);
> > + grub_error_pop();
> > + }
> > +
>
> (The indentation looks wrong in Mozilla Thunderbird, but applying the patch,
> everything is fine. The non-changed lines are indented by two spaces too
> much.)
>
> > if (err)
> > grub_print_error ();
>
>
> Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-03 17:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-01 19:36 [PATCH] disk/pata: Suppress error message "no device connected" Glenn Washburn
2021-03-03 6:23 ` Paul Menzel
2021-03-03 17:05 ` Daniel Kiper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.