aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2021-06-24 12:38:34 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-07-09 18:21:33 +0200
commitf1a74bf976d52409047a187ff4ef1f3ac8c6c612 (patch)
tree60476ea3bb9c2beccc550e46e8dd3f6cfc01770b /hw
parentb7b2a60b01036c6e7c21e7dc41829c7b5f6011b4 (diff)
downloadqemu-f1a74bf976d52409047a187ff4ef1f3ac8c6c612.zip
qemu-f1a74bf976d52409047a187ff4ef1f3ac8c6c612.tar.gz
qemu-f1a74bf976d52409047a187ff4ef1f3ac8c6c612.tar.bz2
monitor/usb: register 'info usbhost' dynamically
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jose R. Ziviani <jziviani@suse.de> Message-Id: <20210624103836.2382472-33-kraxel@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/host-libusb.c1
-rw-r--r--hw/usb/host-stub.c40
-rw-r--r--hw/usb/meson.build4
3 files changed, 2 insertions, 43 deletions
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index e6d21aa..2b7f878 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1781,6 +1781,7 @@ static TypeInfo usb_host_dev_info = {
static void usb_host_register_types(void)
{
type_register_static(&usb_host_dev_info);
+ monitor_register_hmp("usbhost", true, hmp_info_usbhost);
}
type_init(usb_host_register_types)
diff --git a/hw/usb/host-stub.c b/hw/usb/host-stub.c
deleted file mode 100644
index bbe69ba..0000000
--- a/hw/usb/host-stub.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Stub host USB redirector
- *
- * Copyright (c) 2005 Fabrice Bellard
- *
- * Copyright (c) 2008 Max Krasnyansky
- * Support for host device auto connect & disconnect
- * Major rewrite to support fully async operation
- *
- * Copyright 2008 TJ <linux@tjworld.net>
- * Added flexible support for /dev/bus/usb /sys/bus/usb/devices in addition
- * to the legacy /proc/bus/usb USB device discovery and handling
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "qemu/osdep.h"
-#include "hw/usb.h"
-#include "monitor/monitor.h"
-
-void hmp_info_usbhost(Monitor *mon, const QDict *qdict)
-{
- monitor_printf(mon, "USB host devices not supported\n");
-}
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 4f24b52..817f3e0 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -73,9 +73,7 @@ endif
# usb pass-through
softmmu_ss.add(when: ['CONFIG_USB', libusb],
- if_true: files('host-libusb.c'),
- if_false: files('host-stub.c'))
-softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c'))
+ if_true: files('host-libusb.c'))
softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))