diff options
author | Philippe Mathieu-Daudé | 2021-04-25 00:41:10 +0200 |
---|---|---|
committer | Gerd Hoffmann | 2021-05-04 08:38:23 +0200 |
commit | 9c3c834bdda5ca6d58c0e61508737683d12968b5 (patch) | |
tree | fb9bfcc25adfaea88177e24943acdbd2ebc27545 /stubs | |
parent | hw/usb/host-stub: Remove unused header (diff) | |
download | qemu-9c3c834bdda5ca6d58c0e61508737683d12968b5.tar.gz qemu-9c3c834bdda5ca6d58c0e61508737683d12968b5.tar.xz qemu-9c3c834bdda5ca6d58c0e61508737683d12968b5.zip |
hw/usb: Do not build USB subsystem if not required
If the Kconfig 'USB' value is not selected, it is pointless to
build the USB core components. Add a stub for the HMP commands
and usbdevice_create() which is called by usb_device_add in
softmmu/vl.c.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210424224110.3442424-3-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'stubs')
-rw-r--r-- | stubs/meson.build | 1 | ||||
-rw-r--r-- | stubs/usb-dev-stub.c | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/stubs/meson.build b/stubs/meson.build index be6f6d609e..3faef16892 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -50,6 +50,7 @@ if have_block endif if have_system stub_ss.add(files('semihost.c')) + stub_ss.add(files('usb-dev-stub.c')) stub_ss.add(files('xen-hw-stub.c')) else stub_ss.add(files('qdev.c')) diff --git a/stubs/usb-dev-stub.c b/stubs/usb-dev-stub.c new file mode 100644 index 0000000000..b1adeeb454 --- /dev/null +++ b/stubs/usb-dev-stub.c @@ -0,0 +1,25 @@ +/* + * QEMU USB device emulation stubs + * + * Copyright (C) 2021 Philippe Mathieu-Daudé <f4bug@amsat.org> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "sysemu/sysemu.h" +#include "monitor/monitor.h" +#include "hw/usb.h" + +USBDevice *usbdevice_create(const char *driver) +{ + error_report("Support for USB devices not built-in"); + + return NULL; +} + +void hmp_info_usb(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "Support for USB devices not built-in\n"); +} |