Created attachment 424179 [details] Patch to xen.c which marks read-only virtual block devices as CD-ROM's. Install RHEL5 from DVD image on a xen virtual machine. The problem is caused by kudzu not differentiating between xenblk devices representing CD-ROM's or hard-disks. Attached patch fixes the issue.
Seems like a bit of a stretch that any and all r/o block devices are CD-ROMs. Aren't they distinguished any other way?
I couldn't agree more. However since the RHEL5.x kernels are rather old they are in need of the patch: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=440a01a7f46742400c74d9d346118523e81d188b so that xen devices implement the relevant CD-ROM ioctls. Without this patch there is no other way to distinguish them AFAIK. I assume that a corresponding kernel ABI change to make kudzu work properly wouldn't be acceptable? The attached patch ought to be sufficient to allow a xen CD-ROM install to work with minimal side-effects for other use-cases... If the corresponding kernel change is OK, then I can re-work the patch to do things "the right way" (tm).
Apologies for the delay - moving to kernel.
linux-2.6.18-xen.hg: - 208:d2bd9af846b5 - 1036:f5635e334aa5 - 1098:73e47d0fdb10
Created attachment 595765 [details] [1/1] add the CDROM_GET_CAPABILITY ioctl to blkfront Backport of the following two linux-2.6.18-xen.hg commits: changeset: 208:d2bd9af846b5 user: Christian Limpach <Christian.Limpach> date: Tue Sep 11 16:38:13 2007 +0100 files: drivers/xen/blkfront/blkfront.c description: Add the CDROM_GET_CAPABILITY ioctl to blkfront. Return 0 instead of -EINVAL if the blkfront device is a cdrom, i.e. had the VDISK_CDROM attribute. This allows udev's cdrom_id to correctly detect the device as a cdrom device. Signed-off-by: Christian Limpach <Christian.Limpach> (Changeset 1036:f5635e334aa5 moved around the declaration of "info".) changeset: 1098:73e47d0fdb10 user: Jan Beulich <jbeulich> date: Fri Jul 08 13:23:47 2011 +0100 files: drivers/xen/blkfront/blkfront.c description: blkfront: avoid NULL de-reference in CDROM ioctl handling Just like already done in the default case, for CDROM_GET_CAPABILITY info->gd should not be blindly de-referenced, as the ioctl can be called prior to full device setup having completed. Signed-off-by: Jan Beulich <jbeulich> --- drivers/xen/blkfront/blkfront.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Created attachment 595770 [details] test program, to be run in PV guest
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.
Created attachment 595806 [details] test program, to be run in PV guest (v2) fixed compile instruction in leading comment (bogus "-std=c99 -ansi")
Test results on dell-pe1950-07.lab.bos.redhat.com: - host hv/kernel: 2.6.18-308.el5xen (RHEL-5.8) - Sean Waite from eng-ops inserted a readable CD-ROM - RHEL-5 x86_64 PV guest config: disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "phy:/dev/cdrom,xvdb,r" ] - guest kernel: 2.6.18-322.el5xen x86_64 [root@dhcp47-141 ~]# ./checkcd /dev/xvdb checkcd: ioctl("/dev/xvdb"): Invalid argument /dev/xvdb can otherwise be mounted and read. - guest kernel: 2.6.18-322.el5.bz604181_cdromxen x86_64 [root@dhcp47-141 ~]# ./checkcd /dev/xvdb checkcd: capabilities for "/dev/xvdb": 0x00000000 /dev/xvdb can be mounted and read.
Patch(es) available in kernel-2.6.18-330.el5 You can download this test kernel (or newer) from http://people.redhat.com/plougher/el5/ Detailed testing feedback is always welcomed. If you require guidance regarding testing, please ask the bug assignee.
Verified with kernel-xen 2.6.18-342.el5.(reproduced it in guest with kernel-xen-2.6.18-322.el5 previously to confirm the steps) - host kernel: 2.6.18-342.el5xen (RHEL-5.9) - guest kernel: 2.6.18-342.el5xen x86_64 steps: 1. inserted a readable CD-ROM in host 2. create a pv guest. RHEL-5 x86_64 PV guest config: disk=["tap:aio:/data/images/RHEL-Server-5.9-64-pv.raw,xvda,w","phy:/dev/cdrom,xvdb,r"] 3. in guest, run the test program in comment 12 [root@localhost ~]# ./checkcd /dev/xvdb checkcd: capabilities for "/dev/xvdb": 0x00000000 /dev/xvdb can be mounted and read.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0006.html