vm/qubesvm: forbid changing VM name

We've decided to make VM name immutable. This is especially important
for Admin API, where some parts (especially policy) are sticked to the
VM name.

Now, to rename the VM, one need to clone it under new name (thanks to
LVM, this is very quick action), then remove the old one.

Fixes QubesOS/qubes-issues#2868
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-26 02:00:45 +02:00
parent a6c16d00be
commit 3074a4064c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -372,7 +372,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
doc='''Internal, persistent identificator of particular domain. Note
this is different from Xen domid.''')
name = qubes.property('name', type=str,
name = qubes.property('name', type=str, write_once=True,
clone=False,
doc='User-specified name of the domain.')