Skip to contentSkip to conversation

Bluetooth removal, and qtest & misc patches

GIT PULL Thomas Huth 3 participants 14 messages Dec 12, 2019 – Dec 16, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

the following changes since commit 52901abf94477b400cf88c1f70bb305e690ba2de:

Update version for v4.2.0-rc5 release (2019-12-10 17:15:21 +0000)

are available in the Git repository at:

https://gitlab.com/huth/qemu.git tags/pull-request-2019-12-12

for you to fetch changes up to e38f04c4db40a9219cc0c516a6c68b9ca0a783d0:

tests: use g_test_rand_int (2019-12-12 08:16:24 +0100)

----------------------------------------------------------------
- Removal of the deprecated bluetooth code
- Some qtest and misc patches
----------------------------------------------------------------

Cole Robinson (1):
tests: fix modules-test 'duplicate test case' error

Laurent Vivier (1):
pseries: disable migration-test if /dev/kvm cannot be used

Marc-André Lureau (1):
glib: use portable g_setenv()

Markus Armbruster (1):
hw/misc/ivshmem: Bury dead legacy INTx code

Paolo Bonzini (1):
tests: use g_test_rand_int

Thomas Huth (4):
hw/arm/nseries: Replace the bluetooth chardev with a "null" chardev hw/usb: Remove the USB bluetooth dongle device
Remove the core bluetooth code
Remove libbluetooth / bluez from the CI tests

Wainer dos Santos Moschetta (1):
tests/Makefile: Fix check-report.* targets shown in check-help

 .gitlab-ci.yml                             |    2 +-
 Makefile.objs                              |    2 -
 bt-host.c                                  |  198 ---
 bt-vhci.c                                  |  167 --
 configure                                  |   31 -
 hw/Kconfig                                 |    1 -
 hw/Makefile.objs                           |    1 -
 hw/arm/nseries.c                           |   16 +-
 hw/bt/Kconfig                              |    2 -
 hw/bt/Makefile.objs                        |    3 -
 hw/bt/core.c                               |  143 --
 hw/bt/hci-csr.c                            |  512 -------
 hw/bt/hci.c                                | 2263 ----------------------------
 hw/bt/hid.c                                |  553 -------
 hw/bt/l2cap.c                              | 1367 -----------------
 hw/bt/sdp.c                                |  989 ------------
 hw/misc/ivshmem.c                          |   35 -
 hw/usb/Kconfig                             |    5 -
 hw/usb/Makefile.objs                       |    1 -
 hw/usb/dev-bluetooth.c                     |  581 -------
 include/hw/bt.h                            | 2177 --------------------------
 include/sysemu/bt.h                        |   20 -
 include/sysemu/os-win32.h                  |    2 -
 os-win32.c                                 |   22 -
 qemu-deprecated.texi                       |    7 -
 qemu-doc.texi                              |   17 -
 qemu-options.hx                            |   79 -
 tests/Makefile.include                     |    4 +-
 tests/docker/dockerfiles/fedora.docker     |    1 -
 tests/docker/dockerfiles/ubuntu.docker     |    1 -
 tests/docker/dockerfiles/ubuntu1804.docker |    1 -
 tests/ivshmem-test.c                       |    2 +-
 tests/libqtest.c                           |    2 +-
 tests/migration-test.c                     |    3 +-
 tests/modules-test.c                       |    3 +-
 tests/test-bitmap.c                        |    8 +-
 tests/test-crypto-tlscredsx509.c           |    2 +-
 tests/test-crypto-tlssession.c             |    2 +-
 tests/test-io-channel-tls.c                |    2 +-
 tests/test-qga.c                           |    4 +-
 tests/test-vmstate.c                       |    2 +-
 ui/sdl2.c                                  |    2 +-
 vl.c                                       |  136 --
 43 files changed, 26 insertions(+), 9345 deletions(-)
 delete mode 100644 bt-host.c
 delete mode 100644 bt-vhci.c
 delete mode 100644 hw/bt/Kconfig
 delete mode 100644 hw/bt/Makefile.objs
 delete mode 100644 hw/bt/core.c
 delete mode 100644 hw/bt/hci-csr.c
 delete mode 100644 hw/bt/hci.c
 delete mode 100644 hw/bt/hid.c
 delete mode 100644 hw/bt/l2cap.c
 delete mode 100644 hw/bt/sdp.c
 delete mode 100644 hw/usb/dev-bluetooth.c
 delete mode 100644 include/hw/bt.h
 delete mode 100644 include/sysemu/bt.h
#1 lore raw

[PULL 02/10] hw/usb: Remove the USB bluetooth dongle device

We are going to remove the bluetooth backend, so the USB bluetooth dongle can not work anymore. It's a completely optional device, no board depends on it, so let's simply remove it now.

Message-Id: <[email protected]>

---
 hw/usb/Kconfig         |   5 -
 hw/usb/Makefile.objs   |   1 -
 hw/usb/dev-bluetooth.c | 581 -----------------------------------------
 qemu-doc.texi          |  15 --
 4 files changed, 602 deletions(-)
 delete mode 100644 hw/usb/dev-bluetooth.c
hw/usb/Kconfig +0 -5
index 555e09377b..5e70ed5f7b 100644
@@ -82,11 +82,6 @@ config USB_NETWORK
     default y
     depends on USB
 
-config USB_BLUETOOTH
-    bool
-    default y
-    depends on USB
-
 config USB_SMARTCARD
     bool
     default y
hw/usb/Makefile.objs +0 -1
index 303ac084a0..0ab20f9d73 100644
@@ -25,7 +25,6 @@ common-obj-$(CONFIG_USB_STORAGE_UAS)  += dev-uas.o
 common-obj-$(CONFIG_USB_AUDIO)        += dev-audio.o
 common-obj-$(CONFIG_USB_SERIAL)       += dev-serial.o
 common-obj-$(CONFIG_USB_NETWORK)      += dev-network.o
-common-obj-$(CONFIG_USB_BLUETOOTH)    += dev-bluetooth.o
 
 ifeq ($(CONFIG_USB_SMARTCARD),y)
 common-obj-y                          += dev-smartcard-reader.o
hw/usb/dev-bluetooth.c deleted +0 -581

581 lines not on this page · raw message

qemu-doc.texi +0 -15
index ed3df01dac..eea91a2d1e 100644
@@ -983,21 +983,6 @@ For instance, user-mode networking can be used with
 Smartcard reader device
 @item usb-audio
 USB audio device
-@item usb-bt-dongle
-Bluetooth dongle for the transport layer of HCI. It is connected to HCI
-scatternet 0 by default (corresponds to @code{-bt hci,vlan=0}).
-Note that the syntax for the @code{-device usb-bt-dongle} option is not as
-useful yet as it was with the legacy @code{-usbdevice} option. So to
-configure an USB bluetooth device, you might need to use
-"@code{-usbdevice bt}[:@var{hci-type}]" instead. This configures a
-bluetooth dongle whose type is specified in the same format as with
-the @option{-bt hci} option, @pxref{bt-hcis,,allowed HCI types}.  If
-no type is given, the HCI logic corresponds to @code{-bt hci,vlan=0}.
-This USB device implements the USB Transport Layer of HCI.  Example
-usage:
-@example
-@command{@value{qemu_system}} [...@var{OPTIONS}...] @option{-usbdevice} bt:hci,vlan=3 @option{-bt} device:keyboard,vlan=3
-@end example
 @end table
 
 @node host_usb_devices
Signature · 1 line
2.18.1
#2 lore raw

[PULL 05/10] tests: fix modules-test 'duplicate test case' error

In reply to Thomas Huth

From: Cole Robinson <[email protected]>

./configure --enable-sdl --audio-drv-list=sdl --enable-modules

Will generate two identical test names: /$arch/module/load/sdl Which generates an error like:

(tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl

Add the subsystem prefix in the name as well, so instead we get:

/$arch/module/load/audio-sdl
/$arch/module/load/ui-sdl

Message-Id: <d64c9aa098cc6e5c0b638438c4959eddfa7e24e2.1573679311.git.crobinso@redhat.com>

---
 tests/modules-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/modules-test.c +2 -1
index d1a6ace218..88217686e1 100644
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
-        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
+        char *testname = g_strdup_printf("/module/load/%s%s",
+                                         modules[i], modules[i + 1]);
         qtest_add_data_func(testname, modules + i, test_modules_load);
         g_free(testname);
     }
Signature · 1 line
2.18.1
#3 lore raw

[PULL 04/10] Remove libbluetooth / bluez from the CI tests

In reply to Thomas Huth

Since the bluetooth code has been removed, we don't need to test with this library anymore.

Message-Id: <[email protected]>

---
 .gitlab-ci.yml                             | 2 +-
 tests/docker/dockerfiles/fedora.docker     | 1 -
 tests/docker/dockerfiles/ubuntu.docker     | 1 -
 tests/docker/dockerfiles/ubuntu1804.docker | 1 -
 4 files changed, 1 insertion(+), 4 deletions(-)
.gitlab-ci.yml +1 -1
index be57c6a454..a28e389794 100644
@@ -36,7 +36,7 @@ build-disabled:
 
 build-tcg-disabled:
  script:
- - apt-get install -y -qq clang libgtk-3-dev libbluetooth-dev libusb-dev
+ - apt-get install -y -qq clang libgtk-3-dev libusb-dev
  - ./configure --cc=clang --enable-werror --disable-tcg --audio-drv-list=""
  - make -j2
  - make check-unit
tests/docker/dockerfiles/fedora.docker +0 -1
index 4ddc7dd112..f143b26cf3 100644
@@ -2,7 +2,6 @@ FROM fedora:30
 ENV PACKAGES \
     bc \
     bison \
-    bluez-libs-devel \
     brlapi-devel \
     bzip2 \
     bzip2-devel \
tests/docker/dockerfiles/ubuntu.docker +0 -1
index f486492224..1b3b2693d2 100644
@@ -19,7 +19,6 @@ ENV PACKAGES flex bison \
     glusterfs-common \
     libaio-dev \
     libattr1-dev \
-    libbluetooth-dev \
     libbrlapi-dev \
     libbz2-dev \
     libcacard-dev \
tests/docker/dockerfiles/ubuntu1804.docker +0 -1
index 3cc4f492c4..21a5f2c45c 100644
@@ -8,7 +8,6 @@ ENV PACKAGES flex bison \
     glusterfs-common \
     libaio-dev \
     libattr1-dev \
-    libbluetooth-dev \
     libbrlapi-dev \
     libbz2-dev \
     libcacard-dev \
Signature · 1 line
2.18.1
#4 lore raw

[PULL 01/10] hw/arm/nseries: Replace the bluetooth chardev with a "null" chardev

In reply to Thomas Huth

We are going to remove the bitrotten bluetooth backend, so we can not use it in the n800 and n810 machines anymore. Replace the chardev here with a "null" chardev and stop including the "hw/bt.h" header.

I am not aware of a full working N8x0 environment that can be used to test these machines, but the Linux kernel from the Meego project that can be found on http://stskeeps.subnetmask.net/meego-n8x0/ still seems to boot as far as it did before.

Message-Id: <[email protected]>

---
 hw/arm/nseries.c | 16 +++++++---------
 qemu-doc.texi    |  2 --
 2 files changed, 7 insertions(+), 11 deletions(-)
hw/arm/nseries.c +7 -9
index 7e361936a9..3fd196fb30 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
+#include "chardev/char.h"
 #include "qemu/cutils.h"
 #include "qemu/bswap.h"
 #include "sysemu/reset.h"
@@ -39,7 +40,6 @@
 #include "hw/qdev-properties.h"
 #include "hw/block/flash.h"
 #include "hw/hw.h"
-#include "hw/bt.h"
 #include "hw/loader.h"
 #include "hw/sysbus.h"
 #include "qemu/log.h"
@@ -792,13 +792,11 @@ static void n8x0_cbus_setup(struct n800_s *s)
 
 static void n8x0_uart_setup(struct n800_s *s)
 {
-    Chardev *radio = uart_hci_init();
-
-    qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_RESET_GPIO,
-                    csrhci_pins_get(radio)[csrhci_pin_reset]);
-    qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_WKUP_GPIO,
-                    csrhci_pins_get(radio)[csrhci_pin_wakeup]);
-
+    Chardev *radio = qemu_chr_new("bt-dummy-uart", "null", NULL);
+    /*
+     * Note: We used to connect N8X0_BT_RESET_GPIO and N8X0_BT_WKUP_GPIO
+     * here, but this code has been removed with the bluetooth backend.
+     */
     omap_uart_attach(s->mpu->uart[BT_UART], radio);
 }
 
@@ -1137,7 +1135,7 @@ static struct omap_partition_info_s {
     { 0, 0, 0, NULL }
 };
 
-static bdaddr_t n8x0_bd_addr = {{ N8X0_BD_ADDR }};
+static uint8_t n8x0_bd_addr[6] = { N8X0_BD_ADDR };
 
 static int n8x0_atag_setup(void *p, int model)
 {
qemu-doc.texi +0 -2
index 3ddf5c0a68..ed3df01dac 100644
@@ -2308,8 +2308,6 @@ Secure Digital card connected to OMAP MMC/SD host
 @item
 Three OMAP on-chip UARTs and on-chip STI debugging console
 @item
-A Bluetooth(R) transceiver and HCI connected to an UART
-@item
 Mentor Graphics "Inventra" dual-role USB controller embedded in a TI
 TUSB6010 chip - only USB host mode is supported
 @item
Signature · 1 line
2.18.1
#5 lore raw

[PULL 07/10] hw/misc/ivshmem: Bury dead legacy INTx code

In reply to Thomas Huth

From: Markus Armbruster <[email protected]>

Devices "ivshmem-plain" and "ivshmem-doorbell" support only MSI-X. Config space register Interrupt Pin is zero. Device "ivshmem" additionally supported legacy INTx, but it was removed in commit 5a0e75f0a9 "hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device". The commit left ivshmem_update_irq() behind. Since the Interrupt Pin register is zero, the function does nothing. Remove it.

Message-Id: <[email protected]>

---
 hw/misc/ivshmem.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)
hw/misc/ivshmem.c +0 -35
index 5e3b05eae0..710cdb7263 100644
@@ -136,44 +136,11 @@ static inline bool ivshmem_is_master(IVShmemState *s)
     return s->master == ON_OFF_AUTO_ON;
 }
 
-static void ivshmem_update_irq(IVShmemState *s)
-{
-    PCIDevice *d = PCI_DEVICE(s);
-    uint32_t isr = s->intrstatus & s->intrmask;
-
-    /*
-     * Do nothing unless the device actually uses INTx.  Here's how
-     * the device variants signal interrupts, what they put in PCI
-     * config space:
-     * Device variant    Interrupt  Interrupt Pin  MSI-X cap.
-     * ivshmem-plain         none            0         no
-     * ivshmem-doorbell     MSI-X            1        yes(1)
-     * ivshmem,msi=off       INTx            1         no
-     * ivshmem,msi=on       MSI-X            1(2)     yes(1)
-     * (1) if guest enabled MSI-X
-     * (2) the device lies
-     * Leads to the condition for doing nothing:
-     */
-    if (ivshmem_has_feature(s, IVSHMEM_MSI)
-        || !d->config[PCI_INTERRUPT_PIN]) {
-        return;
-    }
-
-    /* don't print ISR resets */
-    if (isr) {
-        IVSHMEM_DPRINTF("Set IRQ to %d (%04x %04x)\n",
-                        isr ? 1 : 0, s->intrstatus, s->intrmask);
-    }
-
-    pci_set_irq(d, isr != 0);
-}
-
 static void ivshmem_IntrMask_write(IVShmemState *s, uint32_t val)
 {
     IVSHMEM_DPRINTF("IntrMask write(w) val = 0x%04x\n", val);
 
     s->intrmask = val;
-    ivshmem_update_irq(s);
 }
 
 static uint32_t ivshmem_IntrMask_read(IVShmemState *s)
@@ -189,7 +156,6 @@ static void ivshmem_IntrStatus_write(IVShmemState *s, uint32_t val)
     IVSHMEM_DPRINTF("IntrStatus write(w) val = 0x%04x\n", val);
 
     s->intrstatus = val;
-    ivshmem_update_irq(s);
 }
 
 static uint32_t ivshmem_IntrStatus_read(IVShmemState *s)
@@ -198,7 +164,6 @@ static uint32_t ivshmem_IntrStatus_read(IVShmemState *s)
 
     /* reading ISR clears all interrupts */
     s->intrstatus = 0;
-    ivshmem_update_irq(s);
     return ret;
 }
 
Signature · 1 line
2.18.1
#6 lore raw

[PULL 09/10] tests/Makefile: Fix check-report.* targets shown in check-help

In reply to Thomas Huth

From: Wainer dos Santos Moschetta <[email protected]>

The check-report.html and check-report.xml targets were replaced with check-report.tap in commit 9df43317b82 but the check-help text was not updated so it still lists check-report.html.

Message-Id: <[email protected]>

---
 tests/Makefile.include | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/Makefile.include +1 -3
index 8566f5f119..680bd8a669 100644
@@ -16,12 +16,10 @@ check-help:
 	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
 	@echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
 	@echo
-	@echo " $(MAKE) check-report.html    Generates an HTML test report"
+	@echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
 	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
 	@echo " $(MAKE) check-clean          Clean the tests and related data"
 	@echo
-	@echo "Please note that HTML reports do not regenerate if the unit tests"
-	@echo "have not changed."
 	@echo
 	@echo "The variable SPEED can be set to control the gtester speed setting."
 	@echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
Signature · 1 line
2.18.1
#7 lore raw

[PULL 06/10] pseries: disable migration-test if /dev/kvm cannot be used

In reply to Thomas Huth

From: Laurent Vivier <[email protected]>

On ppc64, migration-test only works with kvm_hv, and we already have a check to verify the module is loaded.

kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists, but on some systems (like build systems) /dev/kvm can be missing (by administrators choice).

And as kvm_hv exists test-migration is started but QEMU falls back to TCG because it cannot be used:

Could not access KVM kernel module: No such file or directory failed to initialize KVM: No such file or directory Back to tcg accelerator

And as the test is done with TCG, it fails.

As for s390x, we must check for the existence and the access rights of /dev/kvm.

Message-Id: <[email protected]>

---
 tests/migration-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/migration-test.c +2 -1
index ebd77a581a..a5343fdc66 100644
@@ -1349,7 +1349,8 @@ int main(int argc, char **argv)
      * some reason)
      */
     if (g_str_equal(qtest_get_arch(), "ppc64") &&
-        access("/sys/module/kvm_hv", F_OK)) {
+        (access("/sys/module/kvm_hv", F_OK) ||
+         access("/dev/kvm", R_OK | W_OK))) {
         g_test_message("Skipping test: kvm_hv not available");
         return g_test_run();
     }
Signature · 1 line
2.18.1
#8 lore raw

[PULL 08/10] glib: use portable g_setenv()

In reply to Thomas Huth

From: Marc-André Lureau <[email protected]>

We have a setenv() wrapper in os-win32.c that no one is actually using. Drop it and change to g_setenv() uniformly.

Message-Id: <[email protected]>

---
 include/sysemu/os-win32.h        |  2 --
 os-win32.c                       | 22 ----------------------
 tests/libqtest.c                 |  2 +-
 tests/test-crypto-tlscredsx509.c |  2 +-
 tests/test-crypto-tlssession.c   |  2 +-
 tests/test-io-channel-tls.c      |  2 +-
 tests/test-vmstate.c             |  2 +-
 ui/sdl2.c                        |  2 +-
 8 files changed, 6 insertions(+), 30 deletions(-)
include/sysemu/os-win32.h +0 -2
index ff18b23db1..d8978e28c0 100644
@@ -67,8 +67,6 @@ int getpagesize(void);
 # define EPROTONOSUPPORT EINVAL
 #endif
 
-int setenv(const char *name, const char *value, int overwrite);
-
 typedef struct {
     long tv_sec;
     long tv_usec;
os-win32.c +0 -22
index 1336cd34f0..6b86e022f0 100644
@@ -30,28 +30,6 @@
 #include "qemu-options.h"
 #include "sysemu/runstate.h"
 
-/***********************************************************/
-/* Functions missing in mingw */
-
-int setenv(const char *name, const char *value, int overwrite)
-{
-    int result = 0;
-    if (overwrite || !getenv(name)) {
-        size_t length = strlen(name) + strlen(value) + 2;
-        char *string = g_malloc(length);
-        snprintf(string, length, "%s=%s", name, value);
-        result = putenv(string);
-
-        /* Windows takes a copy and does not continue to use our string.
-         * Therefore it can be safely freed on this platform.  POSIX code
-         * typically has to leak the string because according to the spec it
-         * becomes part of the environment.
-         */
-        g_free(string);
-    }
-    return result;
-}
-
 static BOOL WINAPI qemu_ctrl_handler(DWORD type)
 {
     qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_SIGNAL);
tests/libqtest.c +1 -1
index 91e9cb220c..f36e30a4de 100644
@@ -254,7 +254,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
     s->expected_status = 0;
     s->qemu_pid = fork();
     if (s->qemu_pid == 0) {
-        setenv("QEMU_AUDIO_DRV", "none", true);
+        g_setenv("QEMU_AUDIO_DRV", "none", true);
         execlp("/bin/sh", "sh", "-c", command, NULL);
         exit(1);
     }
tests/test-crypto-tlscredsx509.c +1 -1
index a27efb7540..f487349c32 100644
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
 
     module_call_init(MODULE_INIT_QOM);
     g_test_init(&argc, &argv, NULL);
-    setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
+    g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
 
     mkdir(WORKDIR, 0700);
 
tests/test-crypto-tlssession.c +1 -1
index 6560d7134f..8b2453fa79 100644
@@ -398,7 +398,7 @@ int main(int argc, char **argv)
 
     module_call_init(MODULE_INIT_QOM);
     g_test_init(&argc, &argv, NULL);
-    setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
+    g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
 
     mkdir(WORKDIR, 0700);
 
tests/test-io-channel-tls.c +1 -1
index 3c9ef6f941..ad7554c534 100644
@@ -273,7 +273,7 @@ int main(int argc, char **argv)
 
     module_call_init(MODULE_INIT_QOM);
     g_test_init(&argc, &argv, NULL);
-    setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
+    g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
 
     mkdir(WORKDIR, 0700);
 
tests/test-vmstate.c +1 -1
index 1e5be1d4ff..8f184f3556 100644
@@ -1325,7 +1325,7 @@ int main(int argc, char **argv)
 
     module_call_init(MODULE_INIT_QOM);
 
-    setenv("QTEST_SILENT_ERRORS", "1", 1);
+    g_setenv("QTEST_SILENT_ERRORS", "1", 1);
 
     g_test_init(&argc, &argv, NULL);
     g_test_add_func("/vmstate/simple/primitive", test_simple_primitive);
ui/sdl2.c +1 -1
index bd4e73661d..9030f1c42e 100644
@@ -772,7 +772,7 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
      * This is a bit hackish but saves us from bigger problem.
      * Maybe it's a good idea to fix this in SDL instead.
      */
-    setenv("SDL_VIDEODRIVER", "x11", 0);
+    g_setenv("SDL_VIDEODRIVER", "x11", 0);
 #endif
 
     if (SDL_Init(SDL_INIT_VIDEO)) {
Signature · 1 line
2.18.1
#9 lore raw

[PULL 03/10] Remove the core bluetooth code

In reply to Thomas Huth

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.

Message-Id: <[email protected]>

---
 Makefile.objs        |    2 -
 bt-host.c            |  198 ----
 bt-vhci.c            |  167 ----
 configure            |   31 -
 hw/Kconfig           |    1 -
 hw/Makefile.objs     |    1 -
 hw/bt/Kconfig        |    2 -
 hw/bt/Makefile.objs  |    3 -
 hw/bt/core.c         |  143 ---
 hw/bt/hci-csr.c      |  512 ----------
 hw/bt/hci.c          | 2263 ------------------------------------------
 hw/bt/hid.c          |  553 -----------
 hw/bt/l2cap.c        | 1367 -------------------------
 hw/bt/sdp.c          |  989 ------------------
 include/hw/bt.h      | 2177 ----------------------------------------
 include/sysemu/bt.h  |   20 -
 qemu-deprecated.texi |    7 -
 qemu-options.hx      |   79 --
 vl.c                 |  136 ---
 19 files changed, 8651 deletions(-)
 delete mode 100644 bt-host.c
 delete mode 100644 bt-vhci.c
 delete mode 100644 hw/bt/Kconfig
 delete mode 100644 hw/bt/Makefile.objs
 delete mode 100644 hw/bt/core.c
 delete mode 100644 hw/bt/hci-csr.c
 delete mode 100644 hw/bt/hci.c
 delete mode 100644 hw/bt/hid.c
 delete mode 100644 hw/bt/l2cap.c
 delete mode 100644 hw/bt/sdp.c
 delete mode 100644 include/hw/bt.h
 delete mode 100644 include/sysemu/bt.h
Makefile.objs +0 -2
index 11ba1a36bd..4e4d6ddbb3 100644
@@ -65,8 +65,6 @@ common-obj-y += replay/
 
 common-obj-y += ui/
 common-obj-m += ui/
-common-obj-y += bt-host.o bt-vhci.o
-bt-host.o-cflags := $(BLUEZ_CFLAGS)
 
 common-obj-y += dma-helpers.o
 common-obj-y += vl.o
bt-host.c deleted +0 -198

198 lines not on this page · raw message

bt-vhci.c deleted +0 -167

167 lines not on this page · raw message

configure +0 -31
index 6099be1d84..ecce4ada2d 100755
@@ -349,7 +349,6 @@ unset target_list_exclude
 # Distributions want to ensure that several features are compiled in, and it
 # is impossible without a --enable-foo that exits if a feature is not found.
 
-bluez=""
 brlapi=""
 curl=""
 curses=""
@@ -1151,10 +1150,6 @@ for opt do
   ;;
   --enable-brlapi) brlapi="yes"
   ;;
-  --disable-bluez) bluez="no"
-  ;;
-  --enable-bluez) bluez="yes"
-  ;;
   --disable-kvm) kvm="no"
   ;;
   --enable-kvm) kvm="yes"
@@ -1762,7 +1757,6 @@ disabled with --disable-FEATURE, default is enabled if available:
   curl            curl connectivity
   membarrier      membarrier system call (for Linux 4.14+ or Windows)
   fdt             fdt device tree
-  bluez           bluez stack connectivity
   kvm             KVM acceleration support
   hax             HAX acceleration support
   hvf             Hypervisor.framework acceleration support
@@ -3665,26 +3659,6 @@ EOF
   fi
 fi # test "$curl"
 
-##########################################
-# bluez support probe
-if test "$bluez" != "no" ; then
-  cat > $TMPC << EOF
-#include <bluetooth/bluetooth.h>
-int main(void) { return bt_error(0); }
-EOF
-  bluez_cflags=$($pkg_config --cflags bluez 2>/dev/null)
-  bluez_libs=$($pkg_config --libs bluez 2>/dev/null)
-  if compile_prog "$bluez_cflags" "$bluez_libs" ; then
-    bluez=yes
-    libs_softmmu="$bluez_libs $libs_softmmu"
-  else
-    if test "$bluez" = "yes" ; then
-      feature_not_found "bluez" "Install bluez-libs/libbluetooth devel"
-    fi
-    bluez="no"
-  fi
-fi
-
 ##########################################
 # glib support probe
 
@@ -6509,7 +6483,6 @@ if test "$xen" = "yes" ; then
   echo "xen ctrl version  $xen_ctrl_version"
 fi
 echo "brlapi support    $brlapi"
-echo "bluez  support    $bluez"
 echo "Documentation     $docs"
 echo "PIE               $pie"
 echo "vde support       $vde"
@@ -6933,10 +6906,6 @@ if test "$brlapi" = "yes" ; then
   echo "CONFIG_BRLAPI=y" >> $config_host_mak
   echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak
 fi
-if test "$bluez" = "yes" ; then
-  echo "CONFIG_BLUEZ=y" >> $config_host_mak
-  echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
-fi
 if test "$gtk" = "yes" ; then
   echo "CONFIG_GTK=m" >> $config_host_mak
   echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
hw/Kconfig +0 -1
index b9685b3944..ecf491bf04 100644
@@ -4,7 +4,6 @@ source acpi/Kconfig
 source adc/Kconfig
 source audio/Kconfig
 source block/Kconfig
-source bt/Kconfig
 source char/Kconfig
 source core/Kconfig
 source display/Kconfig
hw/Makefile.objs +0 -1
index 66eef20561..660e2b4373 100644
@@ -5,7 +5,6 @@ devices-dirs-y += acpi/
 devices-dirs-y += adc/
 devices-dirs-y += audio/
 devices-dirs-y += block/
-devices-dirs-y += bt/
 devices-dirs-y += char/
 devices-dirs-y += cpu/
 devices-dirs-y += display/
hw/bt/Kconfig deleted +0 -2
deleted file mode 100644
index 554a9ee75e..0000000000
@@ -1,2 +0,0 @@
-config BLUETOOTH
-    bool
hw/bt/Makefile.objs deleted +0 -3
deleted file mode 100644
index 867a7d2e8a..0000000000
@@ -1,3 +0,0 @@
-common-obj-y += core.o l2cap.o sdp.o hci.o hid.o
-common-obj-y += hci-csr.o
-
hw/bt/core.c deleted +0 -143

143 lines not on this page · raw message

hw/bt/hci-csr.c deleted +0 -512

512 lines not on this page · raw message

hw/bt/hci.c deleted +0 -2263

1,886 lines not on this page · raw message

hw/bt/hid.c deleted +0 -553

553 lines not on this page · raw message

hw/bt/l2cap.c deleted +0 -1367

1,367 lines not on this page · raw message

hw/bt/sdp.c deleted +0 -989

989 lines not on this page · raw message

include/hw/bt.h deleted +0 -2177

2,177 lines not on this page · raw message

include/sysemu/bt.h deleted +0 -20
deleted file mode 100644
index 2fd8c0f14b..0000000000

Lines of this file are not shown. View the raw message.

qemu-deprecated.texi +0 -7
index 4b4b7425ac..cba73eed07 100644

Lines of this file are not shown. View the raw message.

qemu-options.hx +0 -79

79 lines not on this page · raw message

vl.c +0 -136

136 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.18.1

Part of the diff is not shown here. View the raw message.

#10 lore raw

[PULL 10/10] tests: use g_test_rand_int

In reply to Thomas Huth

From: Paolo Bonzini <[email protected]>

g_test_rand_int provides a reproducible random integer number, using a different number seed every time but allowing reproduction using the --seed command line option. It is thus better suited to tests than g_random_int or random.

Message-Id: <[email protected]>

---
 tests/ivshmem-test.c | 2 +-
 tests/test-bitmap.c  | 8 ++++----
 tests/test-qga.c     | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
tests/ivshmem-test.c +1 -1
index be9aa92a61..ecda256472 100644
@@ -443,7 +443,7 @@ static gchar *mktempshm(int size, int *fd)
     while (true) {
         gchar *name;
 
-        name = g_strdup_printf("/qtest-%u-%u", getpid(), g_random_int());
+        name = g_strdup_printf("/qtest-%u-%u", getpid(), g_test_rand_int());
         *fd = shm_open(name, O_CREAT|O_RDWR|O_EXCL,
                        S_IRWXU|S_IRWXG|S_IRWXO);
         if (*fd > 0) {
tests/test-bitmap.c +4 -4
index 087e02a26c..2f5b71458a 100644
@@ -22,10 +22,10 @@ static void check_bitmap_copy_with_offset(void)
     bmap2 = bitmap_new(BMAP_SIZE);
     bmap3 = bitmap_new(BMAP_SIZE);
 
-    bmap1[0] = random();
-    bmap1[1] = random();
-    bmap1[2] = random();
-    bmap1[3] = random();
+    bmap1[0] = g_test_rand_int();
+    bmap1[1] = g_test_rand_int();
+    bmap1[2] = g_test_rand_int();
+    bmap1[3] = g_test_rand_int();
     total = BITS_PER_LONG * 4;
 
     /* Shift 115 bits into bmap2 */
tests/test-qga.c +2 -2
index 1ca49bbced..d2b2435bb4 100644
@@ -143,7 +143,7 @@ static void qmp_assertion_message_error(const char     *domain,
 static void test_qga_sync_delimited(gconstpointer fix)
 {
     const TestFixture *fixture = fix;
-    guint32 v, r = g_random_int();
+    guint32 v, r = g_test_rand_int();
     unsigned char c;
     QDict *ret;
 
@@ -186,7 +186,7 @@ static void test_qga_sync_delimited(gconstpointer fix)
 static void test_qga_sync(gconstpointer fix)
 {
     const TestFixture *fixture = fix;
-    guint32 v, r = g_random_int();
+    guint32 v, r = g_test_rand_int();
     QDict *ret;
 
     /*
Signature · 1 line
2.18.1
#11 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

Hi,

the following changes since commit 52901abf94477b400cf88c1f70bb305e690ba2de:

Update version for v4.2.0-rc5 release (2019-12-10 17:15:21 +0000)

are available in the Git repository at:

https://gitlab.com/huth/qemu.git tags/pull-request-2019-12-12

Quoted 8 lines

for you to fetch changes up to e38f04c4db40a9219cc0c516a6c68b9ca0a783d0:

tests: use g_test_rand_int (2019-12-12 08:16:24 +0100)

----------------------------------------------------------------
- Removal of the deprecated bluetooth code
- Some qtest and misc patches
----------------------------------------------------------------

Hi; this fails to build on some of my build hosts:

OSX:
[...]

  GEN     target/sparc/trace.c
  GEN     util/trace.c
  GEN     hw/core/trace.c
  CC      qga/main.o
  CC      qemu-nbd.o
  CC      qemu-img.o

make: *** No rule to make target config-all-devices.mak', needed by aarch64-softmmu/all'. Stop.
make: *** Waiting for unfinished jobs....

ppc64 linux:

  CC      chardev/char-mux.o
  CC      chardev/char-null.o
  CC      chardev/char-parallel.o
  CC      chardev/char-pipe.o
  CC      chardev/char-pty.o
  CC      chardev/char-ringbuf.o
  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o

make: *** No rule to make target /home/pm215/qemu/hw/bt/Kconfig', needed by aarch64-softmmu/config-devices.mak'. Stop.
make: *** Waiting for unfinished jobs....
CC chardev/char-udp.o
make: Leaving directory `/home/pm215/qemu/build/all'

windows crossbuilds:

  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o
  CC      chardev/char-udp.o
  CC      chardev/char-win.o

make: *** No rule to make target '/home/petmay01/qemu-for-merges/hw/bt/Kconfig', needed by 'aarch64-softmmu/config-devices.mak'. Stop.
make: *** Waiting for unfinished jobs....
CC chardev/char-win-stdio.o

It's possible this is a lurking bug in our makefiles where it doesn't regenerate the config-devices dependencies properly; I'm not sure and haven't investigated.

thanks
-- PMM

#12 lore raw
Quoted 31 lines · Peter Maydell
Quoted 11 lines · Thomas Huth

Hi,

the following changes since commit 52901abf94477b400cf88c1f70bb305e690ba2de:

Update version for v4.2.0-rc5 release (2019-12-10 17:15:21 +0000)

are available in the Git repository at:

https://gitlab.com/huth/qemu.git tags/pull-request-2019-12-12

Quoted 8 lines

for you to fetch changes up to e38f04c4db40a9219cc0c516a6c68b9ca0a783d0:

tests: use g_test_rand_int (2019-12-12 08:16:24 +0100)

----------------------------------------------------------------
- Removal of the deprecated bluetooth code
- Some qtest and misc patches
----------------------------------------------------------------

Hi; this fails to build on some of my build hosts:

OSX:
[...]

  GEN     target/sparc/trace.c
  GEN     util/trace.c
  GEN     hw/core/trace.c
  CC      qga/main.o
  CC      qemu-nbd.o
  CC      qemu-img.o
Quoted 3 lines

make: *** No rule to make target config-all-devices.mak', needed by aarch64-softmmu/all'. Stop.
make: *** Waiting for unfinished jobs....

I unfortunately can't reproduce the issue, but if you've got some spare minutes, could you please check whether this patch helps:

Makefile +2 -1
index b437a346d7..23aae1437b 100644
@@ -365,7 +365,8 @@ ifeq ($(SUBDIR_DEVICES_MAK),)
 config-all-devices.mak: config-host.mak
        $(call quiet-command,echo '# no devices' > $@,"GEN","$@")
 else
-config-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak
+config-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak \
+                       $(SRC_PATH)/hw/Kconfig
        $(call quiet-command, sed -n \
              's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
              $(SUBDIR_DEVICES_MAK) | sort -u > $@, \

?

Quoted 23 lines

ppc64 linux:

  CC      chardev/char-mux.o
  CC      chardev/char-null.o
  CC      chardev/char-parallel.o
  CC      chardev/char-pipe.o
  CC      chardev/char-pty.o
  CC      chardev/char-ringbuf.o
  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o

make: *** No rule to make target /home/pm215/qemu/hw/bt/Kconfig', needed by aarch64-softmmu/config-devices.mak'. Stop.
make: *** Waiting for unfinished jobs....
CC chardev/char-udp.o
make: Leaving directory `/home/pm215/qemu/build/all'

windows crossbuilds:

  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o
  CC      chardev/char-udp.o
  CC      chardev/char-win.o
Quoted 5 lines

make: *** No rule to make target '/home/petmay01/qemu-for-merges/hw/bt/Kconfig', needed by 'aarch64-softmmu/config-devices.mak'. Stop.
make: *** Waiting for unfinished jobs....
CC chardev/char-win-stdio.o

These ones are really surprising to me ... *-softmmu/config-devices.mak should have a proper dependency on hw/Kconfig so they should get properly rebuild as far as I can tell. Could you please check the *-softmmu/config-devices.mak.d dependency files whether the dependency on hw/Kconfig is really there? Hmm, maybe "make" also tries to check the old dependency to hw/bt/Kconfig first, before regenerating the files ... not sure how to fix this properly, maybe leave an empty hw/bt/Kconfig around for a while 'til all build systems have regenerated the dependency files?

Thomas

#13 lore raw
Quoted 11 lines · Thomas Huth
Quoted 11 lines

windows crossbuilds:

  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o
  CC      chardev/char-udp.o
  CC      chardev/char-win.o

make: *** No rule to make target '/home/petmay01/qemu-for-merges/hw/bt/Kconfig', needed by 'aarch64-softmmu/config-devices.mak'. Stop.
make: *** Waiting for unfinished jobs....
CC chardev/char-win-stdio.o

Quoted 9 lines

These ones are really surprising to me ... *-softmmu/config-devices.mak should have a proper dependency on hw/Kconfig so they should get properly rebuild as far as I can tell. Could you please check the *-softmmu/config-devices.mak.d dependency files whether the dependency on hw/Kconfig is really there? Hmm, maybe "make" also tries to check the old dependency to hw/bt/Kconfig first, before regenerating the files ... not sure how to fix this properly, maybe leave an empty hw/bt/Kconfig around for a while 'til all build systems have regenerated the dependency files?

I think in the past we've had patches where you just had to force a "make distclean".

Paolo