Bug 971959

Summary: QMP: add error reason to open file failed errors
Product: Red Hat Enterprise Linux 7 Reporter: Luiz Capitulino <lcapitulino>
Component: qemu-kvmAssignee: Laszlo Ersek <lersek>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, hhuang, juzhang, qzhang, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 13:28:41 UTC Type: Bug
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: 987757    

Description Luiz Capitulino 2013-06-07 17:20:04 UTC
Upstream still has some sites using the old QERR_OPEN_FILE_FAILED macro. This hurts error messages as it doesn't include the error reason. Also, RHEL6 got a workaround for this, so we ought to fix this upstream & RHEL7.

To get a listing of the call sites, just do:

$ git grep QERR_OPEN_FILE_FAILED
backends/rng-random.c:            error_set(errp, QERR_OPEN_FILE_FAILED, s->filename)
block.c:                error_set(errp, QERR_OPEN_FILE_FAILED,
block/mirror.c:        error_set(errp, QERR_OPEN_FILE_FAILED, backing_filename);
blockdev.c:        error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
blockdev.c:        error_set(errp, QERR_OPEN_FILE_FAILED, filename);
blockdev.c:        error_set(errp, QERR_OPEN_FILE_FAILED, target);
cpus.c:        error_set(errp, QERR_OPEN_FILE_FAILED, filename);
cpus.c:        error_set(errp, QERR_OPEN_FILE_FAILED, filename);
dump.c:            error_set(errp, QERR_OPEN_FILE_FAILED, p);
include/qapi/qmp/qerror.h:#define QERR_OPEN_FILE_FAILED \
savevm.c:        error_set(errp, QERR_OPEN_FILE_FAILED, filename);

The fix is simple: just convert those calls to error_setg_errno().

Comment 1 Luiz Capitulino 2013-06-10 13:31:12 UTC
Posted series upstream:

https://lists.gnu.org/archive/html/qemu-devel/2013-06/msg01200.html

Comment 2 Luiz Capitulino 2013-07-16 17:03:09 UTC
This is already merged upstream: git log 38aea177d93556aada7c4c7aa530f0050715e293..dbfbc6373441e436ac6e2bcf7a8acb284225aa21

Comment 3 Laszlo Ersek 2013-11-21 13:28:41 UTC
This bug is an exact duplicate of bug 907743 (identical commit ranges to backport).

*** This bug has been marked as a duplicate of bug 907743 ***