Red Hat Bugzilla – Bug 655719
no error pops when change cd to non-exist file
Last modified: 2015-03-04 19:52:24 EST
Description of problem: when change cd to a non-exist file, no error happens. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.120.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create one images test1.img 2. Start qemu with -cdrom test1.img 3. In the qemu monitor enter 'change ide1-cd0 nofile' note: "nofile" is not exist. Actual results: no error pops, and command execute ok. Expected results: Because file is not exist, there should be error happens, like "Could not open 'nofile'" Additional info:
Shirley, Just a note: while I appreciate your testing & report, the real reason this BZ is being fixed is that it also affects QMP, otherwise it wouldn't be fixed, because the user monitor is not supported. I recommend to always test monitor related bugs against QMP. Thanks.
Can reproduce on qemu-kvm-0.12.1.2-2.160.el6. (qemu) change ide1-cd0 /non-exsiting-file (qemu) {"execute":"qmp_capabilities"} {"return": {}} {"execute":"change","arguments":{"device":"ide1-cd0","target":"/non-exsiting-file"}} {"error": {"class": "UndefinedError", "desc": "An undefined error has ocurred", "data": {}}} Re-test on qemu-kvm-0.12.1.2-2.171.el6, this issue doesn't exist. (qemu) change ide1-cd0 /aaa Could not open '/aaa' {"execute":"qmp_capabilities"} {"return": {}} {"execute":"change","arguments":{"device":"ide1-cd0","target":"/aaa"}} {"error": {"class": "OpenFileFailed", "desc": "Could not open '/aaa'", "data": {"filename": "/aaa"}}}
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: QMP's "change" command didn't return error information when opening a file failed. Consequence: A QMP user would get a "undefined error" when trying to use the "change" command to change or insert a non-existent file into the VM's CDROM drive. Fix: Fix the "change" command to return error information. Result: Now the user gets a proper error message instead of "undefined error"
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,4 +1,4 @@ -Cause: QMP's "change" command didn't return error information when opening a file failed. -Consequence: A QMP user would get a "undefined error" when trying to use the "change" command to change or insert a non-existent file into the VM's CDROM drive. +Cause: The monitor's "change" command didn't return error information when opening a file failed. +Consequence: The user would get a "undefined error" or no error message when trying to use the "change" command to change or insert a non-existent file into the VM's CDROM drive. Fix: Fix the "change" command to return error information. -Result: Now the user gets a proper error message instead of "undefined error"+Result: Now the user gets a proper error message
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/RHSA-2011-1531.html