Bug 717606 - screendump fails silently instead of printing an error message
screendump fails silently instead of printing an error message
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
low Severity low
: rc
: 7.0
Assigned To: Luiz Capitulino
Virtualization Bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-29 07:06 EDT by Michal Privoznik
Modified: 2014-06-17 23:12 EDT (History)
10 users (show)

See Also:
Fixed In Version: qemu 1.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 08:00:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michal Privoznik 2011-06-29 07:06:50 EDT
Description of problem:
When trying to do screendump into a previously created file which qemu does not have enough permissions to write to, qemu silently fails writing any data. I'd expect qemu to print error message saying something about write fail. However, other command may be affected as well.

Version-Release number of selected component (if applicable):
0.14.50 but other versions may be affected as well

How reproducible:
100%

Steps to Reproduce:
as root:
1. touch /tmp/screenshot.ppm
2. chmod 0600 /tmp/screenshot.ppm

as normal user:
1. start qemu
2. screendump /tmp/screenshot.ppm
  
Actual results:
qemu fails silently

Expected results:
qemu prints error message about insufficient rights, or unsuccessful write

Additional info:
Comment 2 Michal Privoznik 2011-06-29 08:48:10 EDT
Even better solution might be to even fail on that monitor command.
Comment 5 Luiz Capitulino 2012-08-15 17:10:37 EDT
Michal,

Did you hit this problem in HMP or QMP?

Upstream, this is fixed in both by my series that converts the screendump command to the qapi. This means that this will be fixed in RHEL7.0 too (although my series haven't been merged yet).

For RHEL6.x, we don't support HMP. I could fix this for QMP if it's an issue for libvirt, but it would require a RHEL-only patch which would return limited information...

Is this really needed in 6.4 or can we move it to RHEL7.0?
Comment 6 Michal Privoznik 2012-08-20 06:53:47 EDT
Luiz,

I've reproduced the problem in both HMP and QMP on upstream qemu. I haven't tested RHEL qemu though. Maybe it's because your patches haven't been merged yet.

Even this being tricky bug (qemu and libvirt subsequently report success even for error case) I am okay with moving this to rhel7.
Comment 7 Luiz Capitulino 2012-08-20 09:24:01 EDT
(In reply to comment #6)
> Luiz,
> 
> I've reproduced the problem in both HMP and QMP on upstream qemu. I haven't
> tested RHEL qemu though. Maybe it's because your patches haven't been merged
> yet.

Yes, they haven't. I'll respin my series soon and will CC you when I post it.

> Even this being tricky bug (qemu and libvirt subsequently report success
> even for error case) I am okay with moving this to rhel7.

Closing as DEFERRED then.
Comment 8 Luiz Capitulino 2012-09-11 08:56:43 EDT
The series converting the screendump command to the qapi has been merged upstream (git log 149474c9..0ab6b636) and, as it adds full error handling, it fixes this bug:

(qemu) screendump /tmp/screenshot.ppm
failed to open file '/tmp/screenshot.ppm': Permission denied
(qemu)
Comment 9 Luiz Capitulino 2012-09-18 13:18:19 EDT
Re-opening so that we can track this as a RHEL7 bz.
Comment 10 Luiz Capitulino 2012-09-18 13:21:23 EDT
Complementing last comment: we may need to backport patches merged for qemu 1.3 case we don't rebase (in that case RHEL7's base would be qemu 1.2). So, it's better to reopen this so that we can track it properly.
Comment 13 mazhang 2014-01-21 00:55:13 EST
Reproduced this bug. 
Host:
qemu-kvm-1.2.0-21.el7.x86_64
kernel-3.7.0-0.36.el7.x86_64

Steps:
as root:
1. touch /tmp/screenshot.ppm
2. chmod 0600 /tmp/screenshot.ppm

as normal user:
1. start qemu
2. screendump /tmp/screenshot.ppm

Result:
Qemu fails silently.


Verified this bug with qemu-kvm-1.5.3-38.el7.x86_64.
Host:
kernel-3.10.0-69.el7.x86_64
qemu-kvm-1.5.3-38.el7.x86_64

Result:
Qemu prints error message.
(qemu) screendump  /tmp/screenshot.ppm 
failed to open file '/tmp/screenshot.ppm': Permission denied

This bug has been fixed.
Comment 15 Ludek Smid 2014-06-13 08:00:06 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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