[PATCH 0/2] gdbstub: re-do unlinking of unix socket before bind

Michael Tokarev posted 2 patches 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251225062919.685146-1-mjt@tls.msk.ru
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
gdbstub/user.c    | 30 +++++++++++++++++++++++++++---
stubs/meson.build |  2 --
util/meson.build  |  2 --
3 files changed, 27 insertions(+), 7 deletions(-)
[PATCH 0/2] gdbstub: re-do unlinking of unix socket before bind
Posted by Michael Tokarev 1 month, 1 week ago
Prior discussion is at
https://lore.kernel.org/qemu-devel/ee091002-a552-49fe-ae5e-8916937dba15@tls.msk.ru/

In short: when adding unlink() before bind() for unix socket
in gdbstub/user.c, a previous patch introduced dependency of
linux-user binaries on qemu-sockets.c, which is more problematic
for usually-static binaries.  The monitor_get_fd stub which were
also needed is another example why this might not be the right
approach.

This patchset reverts the previous commit (with fixes for current
code), and adds just a single unlink() to the original code which
handled unix sockets directly.

Michael Tokarev (2):
  Revert "gdbstub: Try unlinking the unix socket before binding"
  gdbstub: unlink the unix socket before bind()

 gdbstub/user.c    | 30 +++++++++++++++++++++++++++---
 stubs/meson.build |  2 --
 util/meson.build  |  2 --
 3 files changed, 27 insertions(+), 7 deletions(-)

-- 
2.47.3
Re: [PATCH 0/2] gdbstub: re-do unlinking of unix socket before bind
Posted by Alex Bennée 1 week, 2 days ago
Michael Tokarev <mjt@tls.msk.ru> writes:

> Prior discussion is at
> https://lore.kernel.org/qemu-devel/ee091002-a552-49fe-ae5e-8916937dba15@tls.msk.ru/
>
> In short: when adding unlink() before bind() for unix socket
> in gdbstub/user.c, a previous patch introduced dependency of
> linux-user binaries on qemu-sockets.c, which is more problematic
> for usually-static binaries.  The monitor_get_fd stub which were
> also needed is another example why this might not be the right
> approach.
>
> This patchset reverts the previous commit (with fixes for current
> code), and adds just a single unlink() to the original code which
> handled unix sockets directly.

This isn't applying cleanly for me. Could you re-base please?

>
> Michael Tokarev (2):
>   Revert "gdbstub: Try unlinking the unix socket before binding"
>   gdbstub: unlink the unix socket before bind()
>
>  gdbstub/user.c    | 30 +++++++++++++++++++++++++++---
>  stubs/meson.build |  2 --
>  util/meson.build  |  2 --
>  3 files changed, 27 insertions(+), 7 deletions(-)

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH 0/2] gdbstub: re-do unlinking of unix socket before bind
Posted by Michael Tokarev 1 week, 2 days ago
On 1/28/26 18:34, Alex Bennée wrote:
> Michael Tokarev <mjt@tls.msk.ru> writes:
> 
>> Prior discussion is at
>> https://lore.kernel.org/qemu-devel/ee091002-a552-49fe-ae5e-8916937dba15@tls.msk.ru/
>>
>> In short: when adding unlink() before bind() for unix socket
>> in gdbstub/user.c, a previous patch introduced dependency of
>> linux-user binaries on qemu-sockets.c, which is more problematic
>> for usually-static binaries.  The monitor_get_fd stub which were
>> also needed is another example why this might not be the right
>> approach.
>>
>> This patchset reverts the previous commit (with fixes for current
>> code), and adds just a single unlink() to the original code which
>> handled unix sockets directly.
> 
> This isn't applying cleanly for me. Could you re-base please?

It isn't applying cleanly because this patchset has been applied
to the master branch already -- a2b429b114e1812e0b3f222818a2755b6d87fb8a
and e916f8b3b68bd9da45245927e2a428c3a0eaea54 .

HTH,

/mjt

Re: [PATCH 0/2] gdbstub: re-do unlinking of unix socket before bind
Posted by Alex Bennée 1 week, 2 days ago
Michael Tokarev <mjt@tls.msk.ru> writes:

> On 1/28/26 18:34, Alex Bennée wrote:
>> Michael Tokarev <mjt@tls.msk.ru> writes:
>> 
>>> Prior discussion is at
>>> https://lore.kernel.org/qemu-devel/ee091002-a552-49fe-ae5e-8916937dba15@tls.msk.ru/
>>>
>>> In short: when adding unlink() before bind() for unix socket
>>> in gdbstub/user.c, a previous patch introduced dependency of
>>> linux-user binaries on qemu-sockets.c, which is more problematic
>>> for usually-static binaries.  The monitor_get_fd stub which were
>>> also needed is another example why this might not be the right
>>> approach.
>>>
>>> This patchset reverts the previous commit (with fixes for current
>>> code), and adds just a single unlink() to the original code which
>>> handled unix sockets directly.
>> This isn't applying cleanly for me. Could you re-base please?
>
> It isn't applying cleanly because this patchset has been applied
> to the master branch already -- a2b429b114e1812e0b3f222818a2755b6d87fb8a
> and e916f8b3b68bd9da45245927e2a428c3a0eaea54 .

Ahh - I was confused as I had it on my list to get to. Sorry for the
noise and thanks.

>
> HTH,
>
> /mjt

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH 0/2] gdbstub: re-do unlinking of unix socket before bind
Posted by Ilya Leoshkevich 1 month ago
On 12/25/25 07:29, Michael Tokarev wrote:
> Prior discussion is at
> https://lore.kernel.org/qemu-devel/ee091002-a552-49fe-ae5e-8916937dba15@tls.msk.ru/
>
> In short: when adding unlink() before bind() for unix socket
> in gdbstub/user.c, a previous patch introduced dependency of
> linux-user binaries on qemu-sockets.c, which is more problematic
> for usually-static binaries.  The monitor_get_fd stub which were
> also needed is another example why this might not be the right
> approach.
>
> This patchset reverts the previous commit (with fixes for current
> code), and adds just a single unlink() to the original code which
> handled unix sockets directly.
>
> Michael Tokarev (2):
>    Revert "gdbstub: Try unlinking the unix socket before binding"
>    gdbstub: unlink the unix socket before bind()
>
>   gdbstub/user.c    | 30 +++++++++++++++++++++++++++---
>   stubs/meson.build |  2 --
>   util/meson.build  |  2 --
>   3 files changed, 27 insertions(+), 7 deletions(-)

Thanks!

Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>