mbox series

[BlueZ,0/3] Fix bluetoothctl hanging if daemon isn't running

Message ID 20240912092253.119754-1-hadess@hadess.net
Headers show
Series Fix bluetoothctl hanging if daemon isn't running | expand

Message

Bastien Nocera Sept. 12, 2024, 9:20 a.m. UTC
Our QE folks have run into this problem multiple times. The problem seems
to have existed since at least 5.56.

Bastien Nocera (3):
  shared/shell: Add bt_shell_get_timeout()
  client: Respect --timeout when bluetoothd isn't running
  shared/shell: Exit after printing the help

 client/main.c      | 21 +++++++++++++++++++--
 src/shared/shell.c |  9 ++++++---
 src/shared/shell.h |  2 ++
 3 files changed, 27 insertions(+), 5 deletions(-)

Comments

Bastien Nocera Sept. 12, 2024, 4:13 p.m. UTC | #1
On Thu, 2024-09-12 at 11:11 -0400, Luiz Augusto von Dentz wrote:
> Hi Bastien,
> 
> On Thu, Sep 12, 2024 at 5:29 AM Bastien Nocera <hadess@hadess.net>
> wrote:
> > 
> > Exit after handling --help, so as to avoid the daemon waiting to
> > communicate with a D-Bus service that might not be running.
> > ---
> >  src/shared/shell.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/src/shared/shell.c b/src/shared/shell.c
> > index c31487190d0f..f7e8b3300373 100644
> > --- a/src/shared/shell.c
> > +++ b/src/shared/shell.c
> > @@ -1324,9 +1324,7 @@ void bt_shell_init(int argc, char **argv,
> > const struct bt_shell_opt *opt)
> >                         return;
> >                 case 'h':
> >                         usage(argc, argv, opt);
> > -                       data.argc = 1;
> > -                       data.argv = &cmplt;
> > -                       data.mode = 1;
> > +                       exit(EXIT_SUCCESS);
> 
> This would undo shared/shell: Print commands when --help option is
> given, so you might want to add print_cmds call.

I'll need to come back to this.

bt_shell_init() is called before the submenus are added, so I can't
call print_cmds() at that point, I'll need to postpone the exit until
after the menus are registered and their help printed.

> 
> >                         goto done;
> >                 case 's':
> >                         if (optarg && data.init_fd < 0) {
> > --
> > 2.46.0
> > 
> > 
> 
>
patchwork-bot+bluetooth@kernel.org Sept. 17, 2024, 2:30 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 12 Sep 2024 11:20:09 +0200 you wrote:
> Our QE folks have run into this problem multiple times. The problem seems
> to have existed since at least 5.56.
> 
> Bastien Nocera (3):
>   shared/shell: Add bt_shell_get_timeout()
>   client: Respect --timeout when bluetoothd isn't running
>   shared/shell: Exit after printing the help
> 
> [...]

Here is the summary with links:
  - [BlueZ,1/3] shared/shell: Add bt_shell_get_timeout()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1428d8461e92
  - [BlueZ,2/3] client: Respect --timeout when bluetoothd isn't running
    (no matching commit)
  - [BlueZ,3/3] shared/shell: Exit after printing the help
    (no matching commit)

You are awesome, thank you!