Bug 1226854
Summary: | automatically generated path for a unix channel contains "(null)" | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | dyuan, honzhang, jdenemar, mzhan, rbalakri, shyu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.17-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 06:39:35 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
Luyao Huang
2015-06-01 09:58:38 UTC
(In reply to Luyao Huang from comment #0) > # virsh start rhel7.0 > error: Failed to start domain rhel7.0 > error: internal error: early end of file from monitor: possible problem: > 2015-06-01T07:20:08.860661Z qemu-system-x86_64: -device > virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel2,id=channel2, > name=com.redhat.spice.0: virtio-serial-bus: A port already exists by name > com.redhat.spice.0 > 2015-06-01T07:20:08.860788Z qemu-system-x86_64: -device > virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel2,id=channel2, > name=com.redhat.spice.0: Device 'virtserialport' could not be initialized The wrong usage of com.redhat.spice.0 for the second channel is covered by bug 1179680. > Also i doubt if this path name is okay > "/var/lib/libvirt/qemu/channel/target/rhel7.0.(null)", maybe use a random > string will be better. This is definitely not OK. Apparently we have a bug in the code which autogenerates paths for UNIX sockets. Let's reword this BZ to only cover this second issue. Sent upstream for review: https://www.redhat.com/archives/libvir-list/2015-June/msg01642.html Fixed upstream by v1.2.17-rc2-5-gffbafd4: commit ffbafd4e883900722cbfc68cd9053d4b42eb38fa Author: Jiri Denemark <jdenemar> Date: Tue Jun 30 13:34:20 2015 +0200 qemu: Avoid using ".(null)" in UNIX socket path The code which generates paths for UNIX socket blindly used target name without checking if it was set. Thus for the following device XML <channel type='unix'> <source mode='bind'/> <target type='virtio'/> </channel> we would generate "/var/lib/libvirt/qemu/channel/target/NAME.(null)" path which works but is not really correct. Let's not use the ".target_name" suffix at all if target name is not set. https://bugzilla.redhat.com/show_bug.cgi?id=1226854 Signed-off-by: Jiri Denemark <jdenemar> Verify this with libvirt-1.2.17-1.el7.x86_64 1. Prepare a xml file as below # cat r7.xml |grep channel -A 4 <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <channel type='unix'> <source mode='bind'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> <channel type='unix'> <source mode='bind'/> <target type='virtio'/> <address type='virtio-serial' controller='0' bus='0' port='3'/> </channel> 2. Create domain with the prepared xml # virsh create r7.xml Domain r7 created from r7.xml 3. Check live guest xml # virsh dumpxml r7|grep channel -A 4 <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0' state='disconnected'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/r7.org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> <alias name='channel1'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/r7'/> <target type='virtio' state='disconnected'/> <alias name='channel2'/> <address type='virtio-serial' controller='0' bus='0' port='3'/> </channel> So the socket path is right now, without suffix ".(null)" A little problem about this is, I can configure the unix path which with ".(null)". Like # virsh dumpxml r7|grep null <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/r7.(null)'/> # virsh start r7 Domain r7 started # ps aux|grep null /usr/libexec/qemu-kvm -name r7 -S -machine .... -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0 -chardev socket,id=charchannel2,path=/var/lib/libvirt/qemu/channel/target/r7.(null), Given that, file with name "file.(null)" is can be created in linux/unix env, so above is acceptable, right? Sure, if you explicitly request such path, there's no reason libvirt should forbid that. Jiri, Thanks. Verify this bug. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2202.html |