[pve-devel] applied: [PATCH v3 container 15/19] prepend underscores for is_volume_in_use helper
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Oct 17 19:40:50 CEST 2019
On 10/14/19 10:28 AM, Oguz Bektas wrote:
> this helper was defined twice, once as 'my $is_volume_in_use' sub and
> second as a helper sub. as our other helpers with a similar structure,
> it is better to prepend the variable sub with two underscores.
>
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
> src/PVE/LXC/Config.pm | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
applied, albeit: nothing to do with this series and one underscore would
have been enough ^^ thanks!
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 729cc08..da5ef03 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -1300,7 +1300,7 @@ sub classify_mountpoint {
> return 'volume';
> }
>
> -my $is_volume_in_use = sub {
> +my $__is_volume_in_use = sub {
> my ($class, $config, $volid) = @_;
> my $used = 0;
>
> @@ -1318,16 +1318,16 @@ sub is_volume_in_use_by_snapshots {
>
> if (my $snapshots = $config->{snapshots}) {
> foreach my $snap (keys %$snapshots) {
> - return 1 if $is_volume_in_use->($class, $snapshots->{$snap}, $volid);
> + return 1 if $__is_volume_in_use->($class, $snapshots->{$snap}, $volid);
> }
> }
>
> return 0;
> -};
> +}
>
> sub is_volume_in_use {
> my ($class, $config, $volid, $include_snapshots) = @_;
> - return 1 if $is_volume_in_use->($class, $config, $volid);
> + return 1 if $__is_volume_in_use->($class, $config, $volid);
> return 1 if $include_snapshots && $class->is_volume_in_use_by_snapshots($config, $volid);
> return 0;
> }
>
More information about the pve-devel
mailing list