[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] Valid characters in domain names?

Does libvirt enforce any sort of validity of characters in guest names?

Someone tried to create a domain called '#' (the single hash
character) and noted that this caused failures in virt-tools:


Had a look at the code but couldn't see anything obvious: It seems
like libvirt delegates this entirely to the drivers, the drivers
(probably) all call virDomainDefParseXML, and this function does no
checking that I could see.

If my analysis is correct, this could be dangerous.  What if the name
contains a character that is special to the qemu command line (','),
to XML ('>'), or to C (�)?

As an example, the code already does:

char *virDomainDefFormat(virDomainDefPtr def,
                         int flags)
  virBufferEscapeString(&buf, "  <name>%s</name>\n", def->name);


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]