Hide Forgot
Description of problem: ------------------------ Qemu-kvm fails to exit when given invalid "-drive" option name or option value. Version-Release number of selected component (if applicable): -------------------------------------------------------------- qemu-kvm-0.12.1.2-2.189.el6.x86_64 How reproducible: ------------------ 100% Steps to Reproduce: -------------------- 1.boot guest with: #/usr/libexec/qemu-kvm -drive option[,option[,option[,...]]] Actual results: ---------------- 1. # /usr/libexec/qemu-kvm -drive 123 qemu-kvm: -drive 123: Invalid parameter '123' VNC server running on `::1:5903' 2. # /usr/libexec/qemu-kvm -drive bus=123 qemu: too many IDE bus (exit) # /usr/libexec/qemu-kvm -drive bus=sfdsd qemu-kvm: -drive bus=sfdsd: Parameter 'bus' expects a number VNC server running on `::1:5904' 3. # /usr/libexec/qemu-kvm -drive index=dfs qemu-kvm: -drive index=dfs: Parameter 'index' expects a number VNC server running on `::1:5905' 4. /usr/libexec/qemu-kvm -drive cyls=sdf qemu-kvm: -drive cyls=sdf: Parameter 'cyls' expects a number VNC server running on `::1:5906' # /usr/libexec/qemu-kvm -drive heads=sdfsd qemu-kvm: -drive heads=sdfsd: Parameter 'heads' expects a number VNC server running on `::1:5906' /usr/libexec/qemu-kvm -drive secs=sdfsd qemu-kvm: -drive secs=sdfsd: Parameter 'secs' expects a number VNC server running on `::1:5906' 5. /usr/libexec/qemu-kvm -drive snapshot=123 qemu-kvm: -drive snapshot=123: Parameter 'snapshot' expects 'on' or 'off' VNC server running on `::1:5906' 6. /usr/libexec/qemu-kvm -drive serial=dsfs VNC server running on `::1:5906' Expected results: ------------------ After prompt error above, it should exit. Additional info: ----------------- Currently, we have "file/if/bus/index/media/cyls/heads/secs/trans/snapshot/cache/aio/format/serial/addr" options for "-drive", tests suggest, when some of them encounter invalid value, they prompt error and exit correctly, ones won't exit are listed in actual results.
I reproduced the reported results. Test case 2 part "bus=123" works as expected. The error message could use polish, though. For all other test cases, upstream exits unsuccessfully, as it should. Additionally, upstream reports for test case 6: qemu: Device needs media, but drive is empty qemu: Initialization of device ide-hd failed
Need at least upstream commit e2982c3a.
Also need upstream commit 98f28ad7 for test case 6.
Test case 7: $ qemu-kvm -drive if=ide Actual results: VNC server running on `127.0.0.1:5900' block I/O error in device 'ide0-hd0': No medium found (123) [doesn't terminate] Expected results: upstream-qemu: Device needs media, but drive is empty upstream-qemu: Initialization of device ide-hd failed [Exit 1 ]
Test case 8: $ qemu-kvm -drive if=virtio Actual results: VNC server running on `127.0.0.1:5900' [doesn't terminate] Expected results: upstream-qemu: -drive if=virtio: Device needs media, but drive is empty upstream-qemu: -drive if=virtio: Device 'virtio-blk' could not be initialized [Exit 1 ]
Verified on qemu-kvm-0.12.1.2-2.222.el6: 1.# /usr/libexec/qemu-kvm -drive 123 qemu-kvm: -drive 123: Invalid parameter '123' 2.# /usr/libexec/qemu-kvm -drive bus=sfdsd qemu-kvm: -drive bus=sfdsd: Parameter 'bus' expects a number 3.# /usr/libexec/qemu-kvm -drive index=dfs qemu-kvm: -drive index=dfs: Parameter 'index' expects a number 4.# /usr/libexec/qemu-kvm -drive cyls=sdf qemu-kvm: -drive cyls=sdf: Parameter 'cyls' expects a number # /usr/libexec/qemu-kvm -drive heads=sdfsd qemu-kvm: -drive heads=sdfsd: Parameter 'heads' expects a number # /usr/libexec/qemu-kvm -drive secs=sdfsd qemu-kvm: -drive secs=sdfsd: Parameter 'secs' expects a number 5.# /usr/libexec/qemu-kvm -drive snapshot=123 qemu-kvm: -drive snapshot=123: Parameter 'snapshot' expects 'on' or 'off' 6.# /usr/libexec/qemu-kvm -drive serial=dsfs qemu-kvm: Device needs media, but drive is empty qemu-kvm: Initialization of device ide-drive failed 7./usr/libexec/qemu-kvm -drive if=ide qemu-kvm: Device needs media, but drive is empty qemu-kvm: Initialization of device ide-drive failed 8./usr/libexec/qemu-kvm -drive if=virtio qemu-kvm: -drive if=virtio: Device needs media, but drive is empty qemu-kvm: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized Based on above results, verified.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: Run qemu-kvm with invalid -drive option name or option value. Consequence: Qemu-kvm fails to run. Fix: [NEEDINFO: Markus, could you please add info? Thanks!] Results: Qemu-kvm starts smoothly.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,11 +1,11 @@ Cause: -Run qemu-kvm with invalid -drive option name or option value. +Invalid -drive arguments are handled incorrectly. Consequence: -Qemu-kvm fails to run. +Some errors are reported, others aren't. Then we continue with a misconfigured drive. Fix: -[NEEDINFO: Markus, could you please add info? Thanks!] +Correct the validation of -drive arguments. Results: -Qemu-kvm starts smoothly.+Invalid -drive arguments are diagnosed, and qemu-kvm refuses to run.
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-2012-0746.html