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.
Bug 923053 - change-media can not insert media on block type cdrom
Summary: change-media can not insert media on block type cdrom
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Gunannan Ren
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-19 05:44 UTC by weizhang
Modified: 2013-11-21 08:52 UTC (History)
11 users (show)

Fixed In Version: libvirt-0.10.2-22.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-21 08:52:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1581 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2013-11-21 01:11:35 UTC

Description weizhang 2013-03-19 05:44:14 UTC
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:

Comment 1 Jiri Denemark 2013-03-19 09:16:39 UTC
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".

Comment 2 Osier Yang 2013-03-21 04:36:41 UTC
(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.

Comment 3 Jiri Denemark 2013-03-21 08:52:44 UTC
The second bug is already covered by bug 888748 requesting RNG validation.

Comment 4 Osier Yang 2013-03-21 11:30:31 UTC
(In reply to comment #3)
> The second bug is already covered by bug 888748 requesting RNG validation.

Hum, it's something I tried to do long time ago, but then forgot.

http://www.redhat.com/archives/libvir-list/2012-January/msg00274.html

I'm going to pick it again.

Comment 5 Gunannan Ren 2013-05-27 13:33:35 UTC
proposed patch sent to upstream
https://www.redhat.com/archives/libvir-list/2013-May/msg01851.html

Comment 13 Xuesong Zhang 2013-08-15 05:46:33 UTC
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".

Comment 15 errata-xmlrpc 2013-11-21 08:52:08 UTC
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


Note You need to log in before you can comment on or make changes to this bug.