Bug 971959 - QMP: add error reason to open file failed errors
QMP: add error reason to open file failed errors
Status: CLOSED DUPLICATE of bug 907743
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Laszlo Ersek
Virtualization Bugs
Depends On:
Blocks: 987757
  Show dependency treegraph
Reported: 2013-06-07 13:20 EDT by Luiz Capitulino
Modified: 2014-04-30 09:55 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-21 08:28:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luiz Capitulino 2013-06-07 13:20:04 EDT
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:

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 09:31:12 EDT
Posted series upstream:

Comment 2 Luiz Capitulino 2013-07-16 13:03:09 EDT
This is already merged upstream: git log 38aea177d93556aada7c4c7aa530f0050715e293..dbfbc6373441e436ac6e2bcf7a8acb284225aa21
Comment 3 Laszlo Ersek 2013-11-21 08:28:41 EST
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.