[spice-gtk,07/44] fixup! usb-redir: define interfaces to support emulated devices

Submitted by Frediano Ziglio on July 30, 2019, 12:02 p.m.

Details

Message ID 20190730120331.17967-8-fziglio@redhat.com
State Superseded
Headers show
Series "Follow ups for CD emulation patch series" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio July 30, 2019, 12:02 p.m.
Remove useless device_type, name is misleading and used only
to understand if is emulated.
This can be checked verifying bus number.
bus number is 16 bits so use G_MAXUINT16 instead of 255
---
 src/usb-backend.c | 1 -
 src/usb-backend.h | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/usb-backend.c b/src/usb-backend.c
index eb228e88..0a830dfb 100644
--- a/src/usb-backend.c
+++ b/src/usb-backend.c
@@ -922,7 +922,6 @@  gboolean spice_usb_backend_create_device(SpiceUsbBackend *be,
     dev = g_new0(SpiceUsbBackendDevice, 1);
     dev->device_info.bus = BUS_NUMBER_FOR_EMULATED_USB;
     dev->device_info.address = address;
-    dev->device_info.device_type = dev_type;
     dev->ref_count = 1;
 
     if (be->dev_init[dev_type](be, dev, param, &edev)) {
diff --git a/src/usb-backend.h b/src/usb-backend.h
index 76c552f5..e898d68a 100644
--- a/src/usb-backend.h
+++ b/src/usb-backend.h
@@ -38,6 +38,8 @@  typedef enum
     USB_DEV_TYPE_MAX
 } UsbEmulatedDeviceType;
 
+#define BUS_NUMBER_FOR_EMULATED_USB G_MAXUINT16
+
 typedef struct UsbDeviceInformation
 {
     uint16_t bus;
@@ -48,7 +50,6 @@  typedef struct UsbDeviceInformation
     uint8_t class;
     uint8_t subclass;
     uint8_t protocol;
-    uint8_t device_type; /* UsbEmulatedDeviceType */
 } UsbDeviceInformation;
 
 typedef void(*usb_hot_plug_callback)(void *user_data, SpiceUsbBackendDevice *dev, gboolean added);
@@ -97,8 +98,6 @@  void spice_usb_backend_channel_get_guest_filter(SpiceUsbBackendChannel *ch,
                                                 int *count);
 void spice_usb_backend_return_write_data(SpiceUsbBackendChannel *ch, void *data);
 
-#define BUS_NUMBER_FOR_EMULATED_USB         255
-
 typedef struct UsbCreateDeviceParameters
 {
     GError *error;