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 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel