Bug 863992

Summary: The domain can't be started while the source path of serial redirect to "/root" path
Product: Red Hat Enterprise Linux 6 Reporter: Xuesong Zhang <xuzhang>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: acathrow, berrange, dallan, dyasny, dyuan, jdenemar, mzhan, rwu, zpeng
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: 2012-10-08 12:45:14 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:

Description Xuesong Zhang 2012-10-08 09:33:42 UTC
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 Berrangé 2012-10-08 10:33:18 UTC
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 13:10:54 UTC
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 18:37:14 UTC
We can't really do much about it in libvirt since the error message ``chardev: opening backend "file" failed'' comes from qemu-kvm.