Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
virsh command change-media can not insert media on block type cdrom
Version-Release number of selected component (if applicable):
rhel6u4 release
How reproducible:
100%
Steps to Reproduce:
1. start a guest with
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide' />
<readonly/>
</disk>
2. Change media
# virsh change-media guest hdc /dev/sdb --insert
succeeded to complete action insert on media
3. Check the domain xml
# virsh dumpxml guest |grep cdrom -A 5
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw' cache='none'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
Actual results:
disk can not be inserted.
Expected results:
disk can be inserted.
Additional info:
This apparently never worked since virsh is generating incorrect XML for block disk types. It uses "<source block='/dev/sdb'/>" while the correct name of the attribute for block disks is "dev".
(In reply to comment #1)
> This apparently never worked since virsh is generating incorrect XML for
> block disk types. It uses "<source block='/dev/sdb'/>" while the correct
> name of the attribute for block disks is "dev".
So this implies 2 bugs: One is of virsh XML generator, one is the qemu API should fail if the XML is not right.
This bug is verified on latest libvirt build: libvirt-0.10.2-22.el6.x86_64
steps:
1. start one guest with the following xml.
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
2. prepare one block disk for inserting, make sure that there is one file on the block disk.
# mount /dev/sdb /mnt
# ls /mnt/
lost+found newfile
# umount /mnt
3. insert the blcok disk to the guest cdrom, the source dev can be seen.
# virsh change-media a hdc /dev/sdb --insert
succeeded to complete action insert on media
# virsh dumpxml a|grep cdrom -A 5
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sdb'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
4. login the guest, make sure the files can be seen in the guest.
# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
# ls /mnt/
lost+found newfile
So, change the bug status to "verify".
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-1581.html
Description of problem: virsh command change-media can not insert media on block type cdrom Version-Release number of selected component (if applicable): rhel6u4 release How reproducible: 100% Steps to Reproduce: 1. start a guest with <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hdc' bus='ide' /> <readonly/> </disk> 2. Change media # virsh change-media guest hdc /dev/sdb --insert succeeded to complete action insert on media 3. Check the domain xml # virsh dumpxml guest |grep cdrom -A 5 <disk type='block' device='cdrom'> <driver name='qemu' type='raw' cache='none'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> Actual results: disk can not be inserted. Expected results: disk can be inserted. Additional info: