Bug 863992 - The domain can't be started while the source path of serial redirect to "/root" path
The domain can't be started while the source path of serial redirect to "/roo...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-08 05:33 EDT by Xuesong Zhang
Modified: 2012-10-08 14:37 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-08 08:45:14 EDT
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)

  None (edit)
Description Xuesong Zhang 2012-10-08 05:33:42 EDT
Description of problem:
The domain can't be started while the source path of serial redirect to "/root" path, it can be started while the source path is other path, such as "/etc" or "/test".
I disabled the selinux to try again, the domain still can't be started and the error message is same as before.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-1.el6
kernel-2.6.32-309.el6.x86_64
qemu-kvm-0.12.1.2-2.316.el6.x86_64
seabios-0.6.1.2-22.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
[on guest]
1. Add console=ttyS0,115200 to guest kernel line.

[on host]
1. Add the following XML to a domain, and delete other serial nodes.
<serial type="file">
   <source path="/root/vm-serial.log"/>
   <target port="1"/>
</serial>
2. Start the domain.

  
Actual results:
The domain can't be started. Below is the error message:
error: Failed to start domain rhel63
error: internal error process exited while connecting to monitor: chardev: opening backend "file" failed

Below is the error message in log:
2012-10-08 07:20:42.607+0000: 2302: error : qemuMonitorOpenUnix:293 : failed to connect to monitor socket: No such process
2012-10-08 07:20:42.607+0000: 2302: error : qemuProcessWaitForMonitor:1644 : internal error process exited while connecting to monitor: chardev: opening backend "file" failed

Expected results:
The domain should be started while the source path is redirect to "/root" path.
If libvirt didn't have the authority, the error message should be reported clearly.

Additional info:
Comment 2 Daniel Berrange 2012-10-08 06:33:18 EDT
The /root directory permissions only allow the root user to access files in it, and QEMU runs as qemu:qemu, so even if libvirt sets the file permissions, the directory permissions will still block access. IMHO this is not a bug, but actually desired behaviour. Don't use /root for this.
Comment 3 Dave Allan 2012-10-08 09:10:54 EDT
Dan, anything we can do to make the error clearer to the user?  It'd be nice to report what file was causing the problem.
Comment 4 Jiri Denemark 2012-10-08 14:37:14 EDT
We can't really do much about it in libvirt since the error message ``chardev: opening backend "file" failed'' comes from qemu-kvm.

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