Bug 971959 - QMP: add error reason to open file failed errors
Summary: QMP: add error reason to open file failed errors
Status: CLOSED DUPLICATE of bug 907743
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm   
(Show other bugs)
Version: 7.0
Hardware: Unspecified Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 987757
TreeView+ depends on / blocked
 
Reported: 2013-06-07 17:20 UTC by Luiz Capitulino
Modified: 2014-04-30 13:55 UTC (History)
6 users (show)

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: ---


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.