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

Frediano Ziglio fziglio at redhat.com
Fri Aug 9 14:26:40 UTC 2019


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(-)

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)
-- 
2.20.1



More information about the Spice-devel mailing list