All of lore.kernel.org
 help / color / mirror / Atom feed
* Need BT support in qemu for Zephyr
@ 2020-04-23 13:33 Dan Christian
  2020-04-23 14:11 ` Daniel P. Berrangé
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Christian @ 2020-04-23 13:33 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

There was a note about BT support being deprecated.

Having it makes developing/testing Zephyr
<https://github.com/zephyrproject-rtos/zephyr> bluetooth vastly easier.

I hope it will be retained.

Thanks,
Dan

[-- Attachment #2: Type: text/html, Size: 341 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Need BT support in qemu for Zephyr
  2020-04-23 13:33 Need BT support in qemu for Zephyr Dan Christian
@ 2020-04-23 14:11 ` Daniel P. Berrangé
  2020-04-23 14:40   ` Dan Christian
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel P. Berrangé @ 2020-04-23 14:11 UTC (permalink / raw)
  To: Dan Christian; +Cc: qemu-devel

On Thu, Apr 23, 2020 at 07:33:37AM -0600, Dan Christian wrote:
> There was a note about BT support being deprecated.
> 
> Having it makes developing/testing Zephyr
> <https://github.com/zephyrproject-rtos/zephyr> bluetooth vastly easier.
> 
> I hope it will be retained.

Unfortunately it has already been deleted and so will be gone in the 5.0
release of QEMU for certain. In theory it could be brought back to life
in future releases, but it would require someone to step forward as an
active maintainer and fix the problems it had.

The big driving reason for deleting it was that it appeared to be largely
broken / crashing as explained in the commit removing it:

commit 1d4ffe8dc77cbc9aafe8bcf514ca0e43f85aaae3
Author: Thomas Huth <thuth@redhat.com>
Date:   Wed Nov 20 10:10:13 2019 +0100

    Remove the core bluetooth code
    
    It's been deprecated since QEMU v3.1. We've explicitly asked in the
    deprecation message that people should speak up on qemu-devel in case
    they are still actively using the bluetooth part of QEMU, but nobody
    ever replied that they are really still using it.
    
    I've tried it on my own to use this bluetooth subsystem for one of my
    guests, but I was also not able to get it running anymore: When I was
    trying to pass-through a real bluetooth device, either the guest did
    not see the device at all, or the guest crashed.
    
    Even worse for the emulated device: When running
    
     qemu-system-x86_64 -bt device:keyboard
    
    QEMU crashes once you hit a key.
    
    So it seems like the bluetooth stack is not only neglected, it is
    completely bitrotten, as far as I can tell. The only attention that
    this code got during the past years were some CVEs that have been
    spotted there. So this code is a burden for the developers, without
    any real benefit anymore. Time to remove it.
    
    Note: hw/bt/Kconfig only gets cleared but not removed here yet.
    Otherwise there is a problem with the *-softmmu/config-devices.mak.d
    dependency files - they still contain a reference to this file which
    gets evaluated first on some build hosts, before the file gets
    properly recreated. To avoid breaking these builders, we still need
    the file around for some time. It will get removed in a couple of
    weeks instead.
    
    Message-Id: <20191120091014.16883-4-thuth@redhat.com>
    Reviewed-by: Ján Tomko <jtomko@redhat.com>
    Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>


Can you give more details about what specific QEMU configuration you are
using with Bluetooth - eg what QEMU command line args are you passing
and how functional was the result? Also what QEMU versions have you
succesfully used BT with ?

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Need BT support in qemu for Zephyr
  2020-04-23 14:11 ` Daniel P. Berrangé
@ 2020-04-23 14:40   ` Dan Christian
  2020-04-23 14:44     ` Daniel P. Berrangé
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Christian @ 2020-04-23 14:40 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

I'm new to trying to use qemu+bt (via btproxy) and haven't managed to get
anything working.

btproxy is launched first, then Zephyr launches qemu via it's west tool.
The commands look like:
sudo tools/btproxy -u -i 0 -d # in a separate window
x86_64-pokysdk-linux/usr/bin/qemu-system-aarch64 -cpu cortex-a53 -nographic
-machine virt -
net none -pidfile qemu.pid -chardev stdio,id=con,mux=on -serial chardev:con
-mon chardev=con,mode=readline -serial unix:/tmp/bt-server-bredr -kernel
/home/dchristian/share-fb/zephyrproject/zephy
r/build/zephyr/zephyr.elf

It's failing with a device busy when btproxy tries to bind to the adapter.
I don't think this is a quemu issue.

Zephyr packages it's own qemu:  QEMU emulator version 4.2.0 (v4.2.0-dirty)

Dan


On Thu, Apr 23, 2020 at 8:11 AM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Thu, Apr 23, 2020 at 07:33:37AM -0600, Dan Christian wrote:
>
>

[-- Attachment #2: Type: text/html, Size: 1679 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Need BT support in qemu for Zephyr
  2020-04-23 14:40   ` Dan Christian
@ 2020-04-23 14:44     ` Daniel P. Berrangé
  2020-04-23 14:55     ` Peter Maydell
  2020-04-23 20:44     ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2020-04-23 14:44 UTC (permalink / raw)
  To: Dan Christian; +Cc: qemu-devel

On Thu, Apr 23, 2020 at 08:40:32AM -0600, Dan Christian wrote:
> I'm new to trying to use qemu+bt (via btproxy) and haven't managed to get
> anything working.
> 
> btproxy is launched first, then Zephyr launches qemu via it's west tool.
> The commands look like:
> sudo tools/btproxy -u -i 0 -d # in a separate window
> x86_64-pokysdk-linux/usr/bin/qemu-system-aarch64 -cpu cortex-a53 -nographic
> -machine virt -
> net none -pidfile qemu.pid -chardev stdio,id=con,mux=on -serial chardev:con
> -mon chardev=con,mode=readline -serial unix:/tmp/bt-server-bredr -kernel
> /home/dchristian/share-fb/zephyrproject/zephy
> r/build/zephyr/zephyr.elf
> 
> It's failing with a device busy when btproxy tries to bind to the adapter.
> I don't think this is a quemu issue.

The command arguments above don't show any use of QEMU's BlueTooth
features. It appears that btproxy is creating a UNIX socket, and QEMU
is just being told to connect a serial port to this UNIX socket. So this
particular setup isn't affected by QEMU removing its BlueTooth support.

As for why it is failing with device busy, I presume this is a btproxy
issue rather than QEMU.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Need BT support in qemu for Zephyr
  2020-04-23 14:40   ` Dan Christian
  2020-04-23 14:44     ` Daniel P. Berrangé
@ 2020-04-23 14:55     ` Peter Maydell
  2020-04-23 20:44     ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2020-04-23 14:55 UTC (permalink / raw)
  To: Dan Christian; +Cc: Daniel P. Berrangé, QEMU Developers

On Thu, 23 Apr 2020 at 15:41, Dan Christian <dchristian@cardinalpeak.com> wrote:
> I'm new to trying to use qemu+bt (via btproxy) and haven't managed to get anything working.

As Dan notes, your command line isn't trying to use any of
QEMU's bluetooth support code. More generally, from the
point of view of the deprecation-and-deletion we were much
more interested in "I am already using this and it works for
me" reports (which we had none of) than in "in theory I might
be interested in bluetooth-emulation-in-QEMU but I'm not
actually using it" reports. Since we had none of the former (and
only one or two of the latter) our current belief is that
the code we removed was in fact broken and nobody was using
it so nobody noticed; if that's true then helping out people
in the "maybe I could use this" camp would require not just
undoing the code removal but actually trying to fix the
bugs and brokenness in it.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Need BT support in qemu for Zephyr
  2020-04-23 14:40   ` Dan Christian
  2020-04-23 14:44     ` Daniel P. Berrangé
  2020-04-23 14:55     ` Peter Maydell
@ 2020-04-23 20:44     ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-04-23 20:44 UTC (permalink / raw)
  To: Dan Christian, Daniel P. Berrangé; +Cc: qemu-devel

On 4/23/20 4:40 PM, Dan Christian wrote:
> I'm new to trying to use qemu+bt (via btproxy) and haven't managed to
> get anything working.
> 
> btproxy is launched first, then Zephyr launches qemu via it's west
> tool.  The commands look like:
> sudo tools/btproxy -u -i 0 -d # in a separate window
> x86_64-pokysdk-linux/usr/bin/qemu-system-aarch64 -cpu cortex-a53
> -nographic -machine virt -
> net none -pidfile qemu.pid -chardev stdio,id=con,mux=on -serial
> chardev:con -mon chardev=con,mode=readline -serial
> unix:/tmp/bt-server-bredr -kernel
> /home/dchristian/share-fb/zephyrproject/zephy
> r/build/zephyr/zephyr.elf
> 
> It's failing with a device busy when btproxy tries to bind to the
> adapter.  I don't think this is a quemu issue.
> 
> Zephyr packages it's own qemu:  QEMU emulator version 4.2.0 (v4.2.0-dirty)

If you just want to test/use BT, you might be luckier with an older
version of QEMU supposed to work with BT, such QEMU v1.0. You won't have
support for Cortex-A53 although.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-23 20:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 13:33 Need BT support in qemu for Zephyr Dan Christian
2020-04-23 14:11 ` Daniel P. Berrangé
2020-04-23 14:40   ` Dan Christian
2020-04-23 14:44     ` Daniel P. Berrangé
2020-04-23 14:55     ` Peter Maydell
2020-04-23 20:44     ` Philippe Mathieu-Daudé

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.