Description of problem: Libvirt rejects name containing '/' in function virDomainDefPostParseCheckFeatures, but it doesn't work for domrename. Refer to: Bug 639923 - libvirt allows you to create a domain with '/' in the name commit b1fc6a7b73f2058742b4c980c2e3573e9d0c65a2 Author: Cole Robinson <crobinso> Date: Tue Apr 26 11:23:12 2016 -0400 conf: domain: reject name containing '/' Version-Release number of selected component (if applicable): # git describe v1.3.4-116-gf4bdf2e How reproducible: 100% Steps to Reproduce: 1) # /usr/local/bin/virsh define /tmp/rhel7.xml error: Failed to define domain from /tmp/rhel7.xml error: XML error: name rhel7/ cannot contain '/' 2) # /usr/local/bin/virsh define /tmp/rhel7.xml Domain rhel7 defined from /tmp/rhel7.xml 3) # /usr/local/bin/virsh domrename rhel7 / Domain successfully renamed # /usr/local/bin/virsh list --all Id Name State ---------------------------------------------------- - / shut off # /usr/local/bin/virsh start / error: Failed to start domain / error: XML error: name / cannot contain '/' Actual results: As step 3, Domrename doesn't check if the name contains '/' Expected results: Reject domrename when the name contains '/' Additional info:
Fixed upstream by: commit 4e1a970 Author: Julio Faracco <jcfaracco> AuthorDate: Tue May 1 12:56:08 2018 -0300 Commit: John Ferlan <jferlan> CommitDate: Thu May 3 11:25:01 2018 -0400 qemu: avoid slash characters to the new domain name. The 'domrename' command needs to check if the new domain name contains the slash character. This character is not accepted by libvirt XML definition because it is an invalid char (see Cole's commit b1fc6a7b7). This commit enhace the 'domrename' command adding this check. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1333232 Signed-off-by: Julio Faracco <jcfaracco> Reviewed-by: John Ferlan <jferlan> $ git describe 4e1a970 v4.3.0-18-g4e1a970