WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have
preserved to ensure that existing links to archives are not broken.
The live archive, which contains the latest emails, can be found at
http://lists.xen.org/

This patch adds the following functionality:
1. CDROM tray un-locking - calls the generic scsi ioctl
(ALLOW_MEDIUM_REMOVAL) in order to unlock the tray each time the cdrom's
status changed. If this patch is not applied, the cdrom physical button
doesn't have any effect.
2. Added cdrom-changed functionality to raw_media_changed()
3. File descriptor caching issue solved - when the cdrom status has
changed, the file descriptor must be re-opened. buggy cdrom drivers
(such as the ide_cd / cdrom generic modules) does not invalidate the
cache. This claim is based on empirical evidence: if you open
/dev/cdrom, get a file descriptor, eject the disk and then read from the
fd, you get cached data. It creates weird behavior when trying to mess
with the emulated cd drive.
How to use?
The cdrom block device path must be '/dev/cdrom" in the HVM
configuration file.
It was tested using a windows xp sp2 hvm guest.
Known Issues:
This patch may need additional work, I guess that it'll be propagated to
qemu if it'll be found useful.
The ALLOW_MEDIUM_REMOVAL ioctl may be harsh with certain distros I guess
(If they interfere and try to mount the cdrom drive).
Didn't check how this affect floppies.
Thanks to Yoav Weiss in his help to identify the problem.
Signed-off-by: Yoav Weiss <yoav@xxxxxxxxxxxx>
Signed-off-by: Guy Zana <guy@xxxxxxxxxxxx>
Thanks,
Guy.