Bug 655719

Summary: no error pops when change cd to non-exist file
Product: Red Hat Enterprise Linux 6 Reporter: Shirley Zhou <szhou>
Component: qemu-kvmAssignee: Luiz Capitulino <lcapitulino>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: ehabkost, juzhang, mkenneth, mshao, qzhang, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.163.el6 Doc Type: Bug Fix
Doc Text:
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
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 15:43:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580953    

Description Shirley Zhou 2010-11-22 09:43:21 UTC
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:

Comment 8 Luiz Capitulino 2011-06-01 17:01:00 UTC
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.

Comment 10 Qunfang Zhang 2011-07-21 09:29:48 UTC
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"}}}

Comment 13 Luiz Capitulino 2011-11-18 13:03:19 UTC
    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"

Comment 14 Luiz Capitulino 2011-11-18 13:21:58 UTC
    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

Comment 15 errata-xmlrpc 2011-12-06 15:43:48 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/RHSA-2011-1531.html