Description of problem:
when the cdrom is locked in the guest,the qmp command cannot eject and change the cdrom with the error "Device XX is locked",but the qemu command can eject and change the cdrom successful.
Version-Release number of selected component (if applicable):
ernel-3.10.0-292.el7.ppc64le
qemu-kvm-rhev-2.3.0-12.el7.ppc64le
guest kernel:
kernel-3.10.0-295.el7.ppc64le
How reproducible:
100%
Steps to Reproduce:
1.Boot the guest with the cdrom:
/usr/libexec/qemu-kvm...-device virtio-scsi-pci,id=scsi0,addr=0x6,bus=pci.0 -drive file=test_27.raw,if=none,id=drive-scsi0,format=raw,cache=none -device scsi-hd,bus=scsi0.0,drive=drive-scsi0,bootindex=0,id=scsi0-0 -drive file=RHEL-7.2-20150720.0-Server-ppc64-dvd1.iso,if=none,media=cdrom,id=drive-scsi1,format=raw -device scsi-cd,drive=drive-scsi1,id=scsi0-1,bus=scsi0.0 ...-qmp tcp:0:4666,server,nowait
2.(qemu) info block
3.(qmp){"execute":"eject","arguments":{"device":"drive-scsi1"}}
4.(qemu) info block
5.(qemu) eject drive-scsi1
6.(qemu) info block
7.reboot the guest with the cdrom,cmd same as step1
8.(qemu) info block
9.(qmp){"execute":"change","arguments":{"device":"drive-scsi1","target":"RHEL-7.2-20150708.1-Server-ppc64-dvd1.iso"}}
10.(qemu) info block
11.(qemu) change drive-scsi1 RHEL-7.2-20150708.1-Server-ppc64-dvd1.iso
12.(qemu) info block
Actual results:
After step3:
{"error": {"class": "GenericError", "desc": "Device 'drive-scsi1' is locked"}}
After step4:
the cdrom is not eject successful
After step5:
the cdrom is eject successful
After step9:
{"error": {"class": "GenericError", "desc": "Device 'drive-scsi1' is locked"}}
After step10:
the cdrom is not changed successful
After step11:
the cdrom is changed successful
Expected results:
the qmp command and the qemu command have the same result.
Additional info:
After step 2:
(qemu) info block
drive-scsi0: test_27.raw (raw)
Cache mode: writeback, direct
drive-scsi1: RHEL-7.2-20150720.0-Server-ppc64-dvd1.iso (raw, read-only)
Removable device: locked, tray closed
Cache mode: writeback
floppy0: [not inserted]
Removable device: not locked, tray closed
sd0: [not inserted]
Removable device: not locked, tray closed
After step4,the result is same as step2
After step6:
(qemu) info block
drive-scsi0: test_27.raw (raw)
Cache mode: writeback, direct
drive-scsi1: [not inserted]
Removable device: locked, tray open
floppy0: [not inserted]
Removable device: not locked, tray closed
sd0: [not inserted]
Removable device: not locked, tray closed
After step8 and step10,the result same as step2
After step12:
(qemu) info block
drive-scsi0: test_27.raw (raw)
Cache mode: writeback, direct
drive-scsi1: RHEL-7.2-20150708.1-Server-ppc64-dvd1.iso (raw, read-only)
Removable device: locked, tray closed
Cache mode: writethrough
floppy0: [not inserted]
Removable device: not locked, tray closed
sd0: [not inserted]
Removable device: not locked, tray closed
Retest this problem on the x86 platform and hit the same issue.
Version-Release number of selected component (if applicable):
qemu-kvm-rhev-0.12.1.2-2.479.el6.x86_64
kernel-2.6.32-567.el6.x86_64
guest kernel:
kernel-3.10.0-295.el7.x86_64