>>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" <diet...@proxmox.com> À: "aderumier" <aderum...@odiso.com> Cc: "pve-devel" <pve-devel@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. _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel