[pve-devel] [PATCH qemu-server 0/2] fix missing lock-type 'clone' in schema-definition
Stoiko Ivanov
s.ivanov at proxmox.com
Tue Dec 4 20:52:45 CET 2018
Defining the return-properties for vm_config exposed this bug:
When cloning a VM, the config gets written with 'lock: clone', and it gets
updated, for every mirrored blockdevice, however 'clone' is not in the enum
for lock (QemuServer.pm).
The first patch adds 'lock' to the enum.
After a short discussion with Dominik off-list, he suggested, that we should
check the config in general more thoroughly.
The second patch adds a check for enum-types in our schema to check_type,
which is called when writing the config into pmxcfs (via cfs_register_file and
write_vm_config).
The same check could be added (at least) for containers and node configs, so I'd
suggest maybe a helper in pve-common/src/PVE/JSONSchema.pm, used for the
check_type subs.
Stoiko Ivanov (2):
add 'clone' to lock schema definition/confdesc.
check_type: compare value to defined enum
PVE/QemuServer.pm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--
2.11.0
More information about the pve-devel
mailing list