[pve-devel] [PATCH v2 qemu-server 04/18] overwrite load_current_config from AbstractConfig

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 2 11:53:53 CEST 2019


On 9/30/19 2:44 PM, Oguz Bektas wrote:
> we overwrite the load_current_config method from AbstractConfig, in
> order to handle cipassword.
> 

see my reply to 05/18 regarding squashing, as when thinking about a
sense full commit message for this the felling that this does not
deserves to be a stand alone patch just got much much stronger.

> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  PVE/QemuConfig.pm | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm
> index edbf1a7..7f229b3 100644
> --- a/PVE/QemuConfig.pm
> +++ b/PVE/QemuConfig.pm
> @@ -397,6 +397,20 @@ sub __snapshot_foreach_volume {
>  
>      PVE::QemuServer::foreach_drive($conf, $func);
>  }
> +
> +sub load_current_config {
> +    my ($class, $vmid, $snapname, $current) = @_;
> +
> +    my $conf = $class->SUPER::load_current_config($vmid, $snapname, $current);
> +
> +    if ($conf->{cipassword}) {
> +	$conf->{cipassword} = '**********';
> +    }
> +
> +    return $conf;
> +}
> +
> +
>  # END implemented abstract methods from PVE::AbstractConfig
>  
>  1;
> 





More information about the pve-devel mailing list