[Spice-devel] [PATCH spice-gtk 33/44] fixup! usb-redir: add implementation of emulated CD device

Frediano Ziglio fziglio at redhat.com
Tue Jul 30 12:03:21 UTC 2019


param field was removed from parameters, read from device.
---
 src/usb-device-cd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c
index a76ea43e..bc1c60d3 100644
--- a/src/usb-device-cd.c
+++ b/src/usb-device-cd.c
@@ -736,6 +736,7 @@ static UsbCd* usb_cd_create(SpiceUsbBackend *be,
     uint32_t unit = 0;
     UsbCd *d = g_new0(UsbCd, 1);
     CdScsiDeviceParameters dev_params = { 0 };
+    uint16_t address = spice_usb_backend_device_get_info(parent)->address;
 
     d->dev_ops = devops;
     d->backend = be;
@@ -744,8 +745,8 @@ static UsbCd* usb_cd_create(SpiceUsbBackend *be,
     d->locked = !d->delete_on_eject;
     d->serial[0] = 0x0308;
     d->serial[1] = 'X';
-    d->serial[2] = '0' + param->address / 10;
-    d->serial[3] = '0' + param->address % 10;
+    d->serial[2] = '0' + address / 10;
+    d->serial[3] = '0' + address % 10;
     d->max_lun_index = MAX_LUN_PER_DEVICE - 1;
 
     dev_params.vendor = "SPICE";
-- 
2.20.1



More information about the Spice-devel mailing list