diff options
author | Markus Armbruster | 2020-06-10 07:32:15 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-06-15 22:05:28 +0200 |
commit | 32aaaebe5665a75f8be8d76ba3ecfcf87627858b (patch) | |
tree | 416976816c8a1654977d941573861452e395577d /include/hw/usb.h | |
parent | ssi: ssi_create_slave_no_init() is now unused, drop (diff) | |
download | qemu-32aaaebe5665a75f8be8d76ba3ecfcf87627858b.tar.gz qemu-32aaaebe5665a75f8be8d76ba3ecfcf87627858b.tar.xz qemu-32aaaebe5665a75f8be8d76ba3ecfcf87627858b.zip |
usb: New usb_new(), usb_realize_and_unref()
I'm converting from qdev_create()/qdev_init_nofail() to
qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New
qdev_new(), qdev_realize(), etc." explains why.
USB devices use qdev_create() through usb_create().
Provide usb_new() and usb_realize_and_unref() for converting USB
devices.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-27-armbru@redhat.com>
Diffstat (limited to 'include/hw/usb.h')
-rw-r--r-- | include/hw/usb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/usb.h b/include/hw/usb.h index e2128c7c45..1cc0ba0fed 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -504,6 +504,8 @@ USBBus *usb_bus_find(int busnr); void usb_legacy_register(const char *typename, const char *usbdevice_name, USBDevice *(*usbdevice_init)(USBBus *bus, const char *params)); +USBDevice *usb_new(const char *name); +bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp); USBDevice *usb_create(USBBus *bus, const char *name); USBDevice *usb_create_simple(USBBus *bus, const char *name); USBDevice *usbdevice_create(const char *cmdline); |