[libvirt] shall libvirtd validate guest's name ?

Ján Tomko jtomko at redhat.com
Thu Jul 9 10:56:21 UTC 2015


On Thu, Jul 09, 2015 at 05:19:29PM +0800, zhang bo wrote:
> linux-ZyvZnF:~ # virsh list --all
>  Id    Name                           State
> ----------------------------------------------------
>  -     redhat7;reboot                 shut off
>  -     oscar-vm-5                     shut off
> 
> 
> As shown above, 
> 1 we use command "virsh define a.xml" to define a guest with a name containing ';', that's 'redhat7;reboot'
> 2 then we start the guest: "virsh start redhat7;reboot"
> 3 shell consider the command as
>   a) run "virsh start redhat7", failed
>   b) run "reboot", to reboot the host
>   And *the host get rebooted*.
> 
> shall libvirtd do the guest-name-validation work? Or other suggustions?

Semicolon is a strange but valid character to use in a domain's name.
It's the user's responsibility to escape any strange characters in the
shell prompt.

We don't allow '/' in domain names because we use them in filenames.
Explicitly rejecting it would be nicer than letting the file creation
fail, but rejecting any new characters would unnecessarily break
existing domains.

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150709/00868174/attachment-0001.sig>


More information about the libvir-list mailing list