[pve-devel] [RFC qemu-server] rewrite description for vm_config

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Sep 5 09:54:22 CEST 2019


On September 4, 2019 3:59 pm, Oguz Bektas wrote:
> the description doesn't match the default behaviour, which is to replace
> the current values with pending ones in the returned config, unless the
> 'current' option is passed.
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
> 
> i tried to come up with a reasonable description, but sending it as RFC
> just in case someone else comes up with something better
> 
>  PVE/API2/Qemu.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index b30931d..36487ee 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -827,7 +827,8 @@ __PACKAGE__->register_method({
>      path => '{vmid}/config',
>      method => 'GET',
>      proxyto => 'node',
> -    description => "Get current virtual machine configuration. This does not include pending configuration changes (see 'pending' API).",
> +    description => "Get virtual machine configuration. If the 'current' option is" .
> +		    " not passed, pending changes will replace the current ones.",

besides style, this is also incorrect since you can pass '0' for 
'current' ;)

Get virtual machine configuration. If 'current' is set, any pending 
configuration changes will not be included in the returned value. 
Otherwise, the returned configuration values will represent the state 
with all pending changes applied.

A bit verbose, but matching what it does. Alternatively, just

Get virtual machine configuration. See 'pending' API for current and 
pending configuration retrieval.

and leave the rest to the parameter description?

current -> "Get current values only (ignoring pending changes)."

>      permissions => {
>  	check => ['perm', '/vms/{vmid}', [ 'VM.Audit' ]],
>      },
> -- 
> 2.20.1
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list