[pve-devel] [RFC v6 qemu-server] VM protection mode
Alen Grizonic
a.grizonic at proxmox.com
Fri Sep 11 08:58:14 CEST 2015
On 09/10/2015 06:44 PM, Dietmar Maurer wrote:
>> @@ -889,6 +897,7 @@ my $update_vm_api = sub {
>> $modified->{$opt} = 1;
>> $conf = PVE::QemuServer::load_config($vmid); # update/reload
>> if ($opt =~ m/^unused/) {
>> + &$check_protection($conf, "can't remove VM $vmid storage");
> strange error message, because you remove a 'volume' (or disk), not a 'storage'.
>
Yes, better.
>> $rpcenv->check_vm_perm($authuser, $vmid, undef, ['VM.Config.Disk']);
>> my $drive = PVE::QemuServer::parse_drive($opt, $conf->{$opt});
>> if (PVE::QemuServer::try_deallocate_drive($storecfg, $vmid, $conf,
>> $opt, $drive, $rpcenv, $authuser)) {
>> @@ -896,11 +905,14 @@ my $update_vm_api = sub {
>> PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
>> }
>> } elsif (PVE::QemuServer::valid_drivename($opt)) {
>> + &$check_protection($conf, "can't remove VM $vmid storage");
> you remove a 'disk' (or 'drive'), but not a 'storage'.
Ok, I'll change also this one.
>
>> $rpcenv->check_vm_perm($authuser, $vmid, undef, ['VM.Config.Disk']);
>> PVE::QemuServer::vmconfig_register_unused_drive($storecfg, $vmid,
>> $conf, PVE::QemuServer::parse_drive($opt, $conf->{pending}->{$opt}))
>> if defined($conf->{pending}->{$opt});
>> PVE::QemuServer::vmconfig_delete_pending_option($conf, $opt, $force);
>> PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
>> + } elsif ($opt eq 'protection') {
>> + &$check_protection($conf, "can't delete VM $vmid protection option");
> Is this really helpful? Why do you think
>
> # qm set <vmid> --protection 0
>
> is better than
>
> # qm set <vmid> --delete protection
>
> IMHO both things are similar?
Both similar. I've put it here so they possibly use the
qm set <vmid> --protection 0
which is used also by the GUI, before they completely remove the option.
Feature to be discussed.
> Note: Some of our GUI widgets automatically send delete instead
> of setting the default value, so that can produce unexpected
> side effects.
More information about the pve-devel
mailing list