If one tries to unload a disk image from virtual drive, which is currently mounted, the unloading succeeds (or appears to succeed) and the drive enters botched state: the virtual device (/dev/sr0) appears busy, even after unmounting all mountpoints, referring to it, and cdemu automatically creates another device in /dev/, which gets used for future mounts. The original device remains botched for a while before spontaneously fixing itself.
The described behaviour is extremely confusing and borderline hostile to users for several reasons:
I believe, that cdemu by default should not allow to unload images, associated with mountpoints. Instead unloading should fail with message, that the device is currently mounted to <insert of="" list="" mountpoints="">. An option to override that behaviour ("--force") may be provided to allow advanced users and automated scripts to ignore the mounted state and revert to older behaviour.</insert>
Can you provide additional details about your setup: distribution, kernel, and desktop environment (if any)?
And the exact steps to reproduce the issue where the device ends in the botched state?
Thanks!