[spice-gtk,v2,22/33] fixup! usb-redir: add files for SCSI and USB MSC implementation

Submitted by Frediano Ziglio on Aug. 9, 2019, 2:26 p.m.

Details

Message ID 20190809142651.2967-23-fziglio@redhat.com
State Superseded
Headers show
Series "CD emulation follow ups" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Aug. 9, 2019, 2:26 p.m.
Set correctly loaded flag in case media_params is NULL.
In case the pointer is NULL the action is the same as an unload.
---
 src/cd-scsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/cd-scsi.c b/src/cd-scsi.c
index d623d665..62c58942 100644
--- a/src/cd-scsi.c
+++ b/src/cd-scsi.c
@@ -531,11 +531,12 @@  static void cd_scsi_lu_load(CdScsiLU *dev,
         dev->size = media_params->size;
         dev->block_size = media_params->block_size;
         dev->num_blocks = media_params->size / media_params->block_size;
+        dev->loaded = TRUE;
     } else {
         dev->media_event = CD_MEDIA_EVENT_MEDIA_REMOVAL;
         cd_scsi_lu_media_reset(dev);
+        dev->loaded = FALSE;
     }
-    dev->loaded = TRUE;
 }
 
 static void cd_scsi_lu_unload(CdScsiLU *dev)