Description of problem: The mode of the vbd cannot be changed Version-Release number of selected component (if applicable): 2.6.18-164.el5xen How reproducible: always Steps to Reproduce: 1. Attach a block: #xm block-attach $domain-name $path/$image-file sdb:cdrom r 2. Change block device configuraton #xm block-configure $domain-name $path/$another-image-file sdb:cdrom w 3. Check whether the configuration can be changed successfully. #xm list -l rhel5u4_fv_x86_64 Actual results: The mode of the vdb cannot be changed(always "r") Expected results: The mode of the vdb can be changed to "w" Additional info:
There's 2 problems with your test scenario here - You can only hotplug paravirt disk devices. Hotplugging of emulated CDROMs will not work. So step 1 should not have succeeded in the first place. - Assuming you had a CDROM device already attached at boot time though, CDROM devices are inherently read-only, hence requesting a "w" flag for CDROM media is meaningless.
Retest again using attached disk with xen-3.0.3-94.el5_4.2: 1.Create new block device: # dd if=/dev/zero of=$image-file bs=1M count=4096 2.Attach the block to a virtual machine: #xm block-attach $domain-id tap:aio:$path/$image-file /dev/hdc w 3.Change disk device configuration: #xm block-configure $domain-id tap:aio:$path/$image-file hdc:disk r And I got the error message: Error: Refusing to reconfigure device tap:5632 to ['tap', ['uname', 'tap:aio:/var/lib/xen/images/rhel5u3_x86_64_kvm.img'], ['dev', 'hdc:disk'], ['mode', 'r']] Usage: xm block-configure <Domain> <BackDev> <FrontDev> <Mode> [BackDomId] Refer to the python script from xen package, does block-configure only support to change cdrom's config file, not support disk type?
I think block-configure is only used to change the back-end device of cdrom of guest. The <Mode> must be "r" and <FrontDev> must be a cdrom device already existed in the guest. Daniel,is that right?
(In reply to comment #3) > I think block-configure is only used to change the back-end device of cdrom of > guest. The <Mode> must be "r" and <FrontDev> must be a cdrom device already > existed in the guest. > Daniel,is that right? I don't know and Daniel could help more, please add needinfo flag next time when you'll be asking somebody for information. Now I'll do it for you. Daniel, usually block-configure is used for changing back-end devices but it should support changing the disk devices too, right? But could it change the mode of device? Thanks, Michal
To the best of my knowledge 'block-configure' is *only* for changing the media in ejectable devices (cdrom/floppy). If you want to change disk devices, you need attach/detach - it is meaningless to change the backing store for a non-ejectable disk. Mode should always be 'r' for a CDROM device. I've no idea if its possible to change mode for a floppy device, in theory it might be possible, but no idea if anyone ever implemented that.
(In reply to comment #5) > To the best of my knowledge 'block-configure' is *only* for changing the media > in ejectable devices (cdrom/floppy). If you want to change disk devices, you > need attach/detach - it is meaningless to change the backing store for a > non-ejectable disk. Mode should always be 'r' for a CDROM device. I've no idea > if its possible to change mode for a floppy device, in theory it might be > possible, but no idea if anyone ever implemented that. Hi, Berrange, Is it valid for PV guest to change the backend device of CDROM? When I change backend device of CDROM in rhel5.4 PV guest, it will update xenstore at once, but need reboot the guest to make the change take effect.
There is *NO* CDROM device emulation for PV guests. CDROMs are only present for HVM guests.
Close this bug, since comment 5
This bug was closed during 5.5 development and it's being removed from the internal tracking bugs (which are now for 5.6).