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 1124815 - fail to detect the new cdrom device in guest after "change" it to anther iso (scsi-cd only)
Summary: fail to detect the new cdrom device in guest after "change" it to anther iso ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: John Snow
QA Contact: FuXiangChun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-30 11:49 UTC by chcheng
Modified: 2016-11-07 20:15 UTC (History)
10 users (show)

Fixed In Version: qemu 2.6.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-07 20:15:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2673 0 normal SHIPPED_LIVE qemu-kvm-rhev bug fix and enhancement update 2016-11-08 01:06:13 UTC

Description chcheng 2014-07-30 11:49:43 UTC
Description of problem:
The new cdrom device can not be detected in guest after "change" it to anther iso (virtio-cd only) with qemu-kvm-rhev-2.1.0.
BTW,
1.Also tried the IDE which did not hit it.
2.Also tried the qemu-kvm-1.5.3-64 with the same steps which did not hit it.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-132.el7.x86_64
qemu-kvm-rhev-2.1.0-1.el7ev.preview.x86_64
guest info:
# uname -r
3.10.0-132.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot with QMP enabled like:...-qmp tcp:0:4444,server -device virtio-scsi-pci,bus=pci.0,addr=0x9,id=scsi1  -drive file=/home/aaa.iso,format=raw,if=none,id=cdrom1,werror=stop,rerror=stop,cache=none    -device ide-drive,bus=ide.0,unit=0,drive=cdrom1,id=ide0-0-0 
2.from any box with telnet client
run #telnet $HostIP 4444
3.query the existing cdrom device in QMP and check it in guest.
QMP:
{"execute": "qmp_capabilities"}
{"execute": "query-block"}
in guest:
# ls /dev/cdrom -lh 
4.change the cdrom to anther one.
QMP: 
{"execute":"eject","arguments":{"device":"cdrom1"}}
{"execute":"change","arguments":{"device":"cdrom1","target":"/home/bbb.iso"}}
5. query the new cdrom in QMP and in guest.
QMP:
{"execute": "query-block"}
in guest:
# ls /dev/cdrom -lh 
# mount /dev/cdrom /mnt


Actual results:
after step 5,the new cdrom device can not be seen in guest, but can be seen in QMP.
in guest:
# ls /dev/cdrom -lh 
lrwxrwxrwx. 1 root toot 3 Jul 31 03:41 /dev/cdrom -> sr0
# mount /dev/cdrom /mnt
mount:no medium found on /dev/sr0
QMP:
{"execute": "query-block"}
 ... "image": {"virtual-size": 4268605440, "filename": "/home/bbb.iso", "format": "raw", "actual-size": 4268605440, "dirty-flag": false}...

BTW,it can be detected in guest after reboot the KVM guest.

Expected results:
after step 5,the new cdrom device can be detected both in guest and QMP.

Additional info:

Comment 2 Sibiao Luo 2014-07-30 12:46:22 UTC
(In reply to chcheng from comment #0)
> Description of problem:
> The new cdrom device can not be detected in guest after "change" it to
> anther iso (virtio-cd only) with qemu-kvm-rhev-2.1.0.
> BTW,
> 1.Also tried the IDE which did not hit it.
> 2.Also tried the qemu-kvm-1.5.3-64 with the same steps which did not hit it.
> 
> Steps to Reproduce:
> 1.boot with QMP enabled like:...-qmp tcp:0:4444,server -device
> virtio-scsi-pci,bus=pci.0,addr=0x9,id=scsi1  -drive
> file=/home/aaa.iso,format=raw,if=none,id=cdrom1,werror=stop,rerror=stop,
> cache=none    -device ide-drive,bus=ide.0,unit=0,drive=cdrom1,id=ide0-0-0 
Just scsi-cd interface hit it while ide-cd not hit it, but you paste the wrong qemu-kvm command line. Please paste your right cmdline.

Best Regards,
sluo

Comment 3 chcheng 2014-07-30 13:00:39 UTC
hi,all. sorry for my carelessness.
the Steps 1 to Reproduce should be:
1.boot with QMP enabled like:...-qmp tcp:0:4444,server -device virtio-scsi-pci,bus=pci.0,addr=0x9,id=scsi1 -drive file=/home/aaa.iso,if=none,media=cdrom,readonly=on,format=raw,id=cdrom1 -device scsi-cd,bus=scsi0.0,drive=cdrom1,id=scsi0-0

Other steps remains the same.

(In reply to chcheng from comment #0)

> Steps to Reproduce:
> 1.boot with QMP enabled like:...-qmp tcp:0:4444,server -device
> virtio-scsi-pci,bus=pci.0,addr=0x9,id=scsi1  -drive
> file=/home/aaa.iso,format=raw,if=none,id=cdrom1,werror=stop,rerror=stop,
> cache=none    -device ide-drive,bus=ide.0,unit=0,drive=cdrom1,id=ide0-0-0

Comment 4 lijin 2014-11-06 06:52:03 UTC
windows guest also hit the same issue when change scsi-cd iso image,and after reboot guest,the new iso image can be seen in guest.

package info:
qemu-kvm-rhev-2.1.2-5.el7.x86_64
kernel-3.10.0-196.el7.x86_64
virtio-win-prewhql-92
seabios-1.7.5-5.el7.x86_64

Comment 7 John Snow 2016-06-08 19:26:13 UTC
Appears to work correctly on current upstream master:

/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 4096 -cpu host -M pc -smp 4 -qmp tcp::4444,server,nowait -hda /media/ext/img/f24b.qcow2 -drive id=cd0,media=cdrom,file=/media/ext/iso/Fedora-Workstation-Live-x86_64-24_Beta-1.6.iso,if=none,format=raw -device virtio-scsi-pci,id=scsi-pci -device scsi-cd,bus=scsi-pci.0,drive=cd0,id=scsicd -monitor stdio


(QEMU) eject device=cd0
{
    "execute": "eject", 
    "arguments": {
        "device": "cd0"
    }
}
{
    "error": {
        "class": "GenericError", 
        "desc": "Device 'cd0' is locked and force was not specified, wait for tray to open and try again"
    }
}
(QEMU) eject device=cd0
{
    "execute": "eject", 
    "arguments": {
        "device": "cd0"
    }
}
{
    "return": {}
}
(QEMU) change device=cd0 target=/media/ext/iso/linux/Fedora-Live-Workstation-x86_64-23-10.iso
{
    "execute": "change", 
    "arguments": {
        "device": "cd0", 
        "target": "/media/ext/iso/linux/Fedora-Live-Workstation-x86_64-23-10.iso"
    }
}
{
    "return": {}
}
(QEMU) 



After the "eject" the mounted ISO is removed from the gnome Files visualizer, and after "change" the new ISO is clearly visible. During re-testing, please ensure that the "change" command completes successfully. It is not necessary to 'eject' first when using the 'change' command, either.

Comment 9 FuXiangChun 2016-09-08 09:58:39 UTC
verified the bug with qemu-kvm-rhev-2.6.0-23.el7

1./usr/libexec/qemu-kvm -boot menu=on -m 2G -vnc :1 -object iothread,id=iothread0 -drive file=rbd:libvirt-pool/rhel.raw:mon_host=10.66.144.26,format=raw,if=none,id=drive-scsi-disk0,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0,iothread=iothread0 -device scsi-hd,drive=drive-scsi-disk0,bus=scsi0.0,scsi-id=0,lun=0,id=scsi-disk0 -qmp tcp:0:6666,server,nowait -device virtio-scsi-pci,bus=pci.0,addr=0x9,id=scsi1 -drive file=/home/aaa.iso,if=none,media=cdrom,readonly=on,format=raw,id=cdrom1 -device scsi-cd,bus=scsi0.0,drive=cdrom1,id=scsi0-0 -monitor stdio

2.query the existing cdrom device in QMP and check it in guest.
QMP:
{"execute": "qmp_capabilities"}
{"execute": "query-block"}
in guest:
# ls /dev/cdrom -lh 
3.change the cdrom to anther one.
QMP: 
{"execute":"eject","arguments":{"device":"cdrom1"}}
{"execute":"change","arguments":{"device":"cdrom1","target":"/home/bbb.iso"}}
4. query the new cdrom in QMP and in guest.
QMP:
{"execute": "query-block"}
in guest:
# ls /dev/cdrom -lh 
# mount /dev/cdrom /mnt

result:
after step4, mount is successful. the new cdrom device can be detected both in guest and QMP

Comment 11 errata-xmlrpc 2016-11-07 20:15:01 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.

https://rhn.redhat.com/errata/RHBA-2016-2673.html


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