Bug 1453194

Summary: Guest with 247-characters name-length failed to start
Product: Red Hat Enterprise Linux 7 Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Fangge Jin <fjin>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: dyuan, jsuchane, lizhu, rbalakri, xuzhang, yafu, yanqzhan, zpeng
Target Milestone: rcKeywords: Regression, Upstream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.7.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 10:44:33 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 Fangge Jin 2017-05-22 11:22:46 UTC
Description of problem:
Guest with 248-characters name-length failed to start

Version-Release number of selected component:
libvirt-3.2.0-5.virtcov.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest with 248-characters name-length:
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 shut off

2. Start guest:
# virsh start 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
error: Failed to start domain 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
error: internal error: Process exited prior to exec: libvirt: QEMU Driver error : Failed to create /var/run/libvirt/qemu/1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.hugepages: File name too long

3.An empty dir $guest.dev is left in /var/lib/libvirt/qemu/
# ls /var/run/libvirt/qemu/
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.dev

Actual results:
Guest failed to start

Expected results:
Guest can start successfully.

Additional info:
Same guest can start successfully on RHEL7.3

Comment 3 Martin Kletzander 2017-08-23 11:56:26 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2017-August/msg00635.html

Comment 4 Martin Kletzander 2017-08-29 09:27:53 UTC
Fixed upstream with v3.6.0-230-gf5ef291bdb2c:
commit f5ef291bdb2c7616f342efc20e2322e48c038eca
Author: Martin Kletzander <mkletzan>
Date:   Wed Aug 23 10:39:57 2017 +0200

    qemu: Use short domain name in qemuDomainGetPreservedMountPath

Comment 6 Fangge Jin 2017-10-24 03:08:03 UTC
Verify with libvirt-3.8.0-1.virtcov.el7.x86_64, guest starts successfully with the long name

Comment 10 errata-xmlrpc 2018-04-10 10:44:33 UTC
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://access.redhat.com/errata/RHEA-2018:0704