Description of problem: "virsh start" succeeds even if an invalid guest name is configured to an xml file. Assume an invalid "#" is specified as a domain name, "virsh start" should report an error message like "invalid domain name", but the guest is started successfully without any errors. # is an illegal name. When I try to name a guest as # via virt-manager, it says. "Invalid system name, Guest name can only contain alphanumeric, '-', '.' or '-' characters." So virsh would report an error message and should not start the guest. Version-Release number of selected component: Red Hat Enterprise Linux Version Number: 6 Release Number: snapshot13 Architecture: x86_64 Kernel Version: kernel-2.6.32-70.el6.x86_64 Related Package Version: libvirt-client-0.8.1-27.el6.x86_64 How reproducible: Always. Steps to Reproduce: 1. Edit the xml file and change the name of the guest to # <domain type='kvm'> <name>#</name> <uuid>92ae9226-70ca-d0e8-ab41-2ebfe2edbf3c</uuid> <memory>1048576</memory> 2.start the guest # virsh start \# Domain # started # virsh dumpxml \# <domain type='kvm' id='1'> <name>#</name> <uuid>92ae9226-70ca-d0e8-ab41-2ebfe2edbf3c</uuid> <memory>1048576</memory> <currentMemory>1048576</currentMemory> # virsh list Id Name State ---------------------------------- 1 # running Actual results: virsh is able to start the guest if an invalid name is specified in the guest xml file. Expected results: virsh should report an error and should not start the guest. Additional info:
virsh does not enforce the XML schema for permissible domain names. However, the XML schema needs to be very broad to encompass all possible valid names across all hypervisors, and the validity of the name should be enforced by the hypervisor driver or the hypervisor. IMO, the bug is that the domain.rng is too restrictive, as "#" may be a valid name for some hypervisors. I'm closing this bz as a duplicate of 639599, and we can discuss the proper behavior there. BTW, it's perfectly correct for virt-manager to enforce a stricter definition of what's a valid name. *** This bug has been marked as a duplicate of bug 639599 ***