[pve-devel] [PATCH 4/5] volid_path sub : check if $ms is undef

Alexandre DERUMIER aderumier at odiso.com
Fri Aug 21 10:59:03 CEST 2015


>>Why do we check for defined '$ms'? I thought we always pass this?

I have only 1case, when create rootfs (last patch), I need to mount the root myself (mountpoint_mount sub),
and if I pass 'rootfs' as $ms, it's return "cloop:$path".

So currently I pass undef in this case. (this was to avoid to introduce a new variable in the sub)

----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>, "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Vendredi 21 Août 2015 10:44:39
Objet: Re: [pve-devel] [PATCH 4/5] volid_path sub : check if $ms is undef

On 08/21/2015 08:05 AM, Alexandre Derumier wrote: 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com> 
> --- 
> src/PVE/LXC.pm | 4 ++-- 
> 1 file changed, 2 insertions(+), 2 deletions(-) 
> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm 
> index da9f72e..f8a1b58 100644 
> --- a/src/PVE/LXC.pm 
> +++ b/src/PVE/LXC.pm 
> @@ -1858,8 +1858,8 @@ sub volid_path { 
> } elsif ($format eq 'raw') { 
> 
> if ($scfg->{path}) { 
> - if ($ms eq 'rootfs') { 
> - $path = "loop:$path\n" if $ms eq 'rootfs'; 
> + if ($ms && $ms eq 'rootfs') { 
> 

Why do we check for defined '$ms'? I thought we always pass this? 



More information about the pve-devel mailing list