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/
Home Products Support Community News


[Xen-devel] [QEMU][PATCH] Fix hvm cdrom issues

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [QEMU][PATCH] Fix hvm cdrom issues
From: "Guy Zana" <guy@xxxxxxxxxxxx>
Date: Thu, 30 Aug 2007 14:19:08 -0400
Cc: Yoav Weiss <yoav@xxxxxxxxxxxx>, fabrice@xxxxxxxxxxx
Delivery-date: Thu, 30 Aug 2007 11:20:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcfrMYzxegcs9Yv7SQqjpJMwbFr5ug==
Thread-topic: [QEMU][PATCH] Fix hvm cdrom issues
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>

Attachment: cdrom_fix.patch
Description: cdrom_fix.patch

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [QEMU][PATCH] Fix hvm cdrom issues, Guy Zana <=