[pve-devel] [PATCH 3/7] resize disk : allow resize pending disk

Alexandre DERUMIER aderumier at odiso.com
Fri Jan 2 11:32:37 CET 2015


>>To implement, you can simply do: 
>>
>>foreach my $opt (PVE::Tools::split_list($param->{revert})) { 
>>$param->{$opt} = $conf->{opt} if define($conf->{$opt}; 
>>} 

Ok, I'll try to implement this.

>>The rest is done by existing code, which already detects and 
>>removes pending values if nothing changed. 

For pending disk, does it put them as unused ?


----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Vendredi 2 Janvier 2015 10:17:56
Objet: Re: [pve-devel] [PATCH 3/7] resize disk : allow resize pending disk

> Also, it's missing currently the "revert pending change" api. 
> 
> I don't known what is the best way ? 
> 
> extend update_vm api with an additionnal param? 
> 
> #qm -delete -pending -virtio0 

I thought about a new parameter called 'revert': 

revert => { 
type => 'string', format => 'pve-configid-list', 
description => "A list of settings you want to revert (remove pending 
changes).", 
optional => 1, 
}, 

So you can simple do: 

# qm set <VMID> -revert virtio 

Note: similar to delete 

To implement, you can simply do: 

foreach my $opt (PVE::Tools::split_list($param->{revert})) { 
$param->{$opt} = $conf->{opt} if define($conf->{$opt}; 
} 

The rest is done by existing code, which already detects and 
removes pending values if nothing changed. 



More information about the pve-devel mailing list