[pve-devel] [PATCH storage v4 02/12] storage: replace build-in stat with File::stat

Alwin Antreich a.antreich at proxmox.com
Thu Apr 23 09:47:44 CEST 2020


On Thu, Apr 23, 2020 at 05:52:29AM +0200, Dietmar Maurer wrote:
> > On April 22, 2020 6:00 PM Alwin Antreich <a.antreich at proxmox.com> wrote:
> > 
> >  
> > On Wed, Apr 22, 2020 at 05:35:05PM +0200, Dietmar Maurer wrote:
> > > AFAIK this can have ugly side effects ...
> > Okay, I was not aware of any know side effects.
> > 
> > I took the File::stat, since we use it already in pve-cluster,
> > qemu-server, pve-common, ... . And a off-list discussion with Thomas and
> > Fabian G.
> > 
> > If there is a better solution, I am happy to work on it.
> 
> 
> # grep -r "use File::stat" /usr/share/perl5/PVE/
> /usr/share/perl5/PVE/QemuServer/Helpers.pm:use File::stat;
> /usr/share/perl5/PVE/Storage/ISCSIPlugin.pm:use File::stat;
> /usr/share/perl5/PVE/APIServer/AnyEvent.pm:use File::stat qw();
> /usr/share/perl5/PVE/AccessControl.pm:use File::stat;
> /usr/share/perl5/PVE/Cluster.pm:use File::stat qw();
> /usr/share/perl5/PVE/LXC/Setup/Base.pm:use File::stat;
> /usr/share/perl5/PVE/QemuServer.pm:use File::stat;
> /usr/share/perl5/PVE/INotify.pm:use File::stat;
> /usr/share/perl5/PVE/API2/APT.pm:use File::stat ();
> 
> So I would use:
> 
> use File::stat qw();
> 
> to avoid override the core stat() and lstat() functions.
Thank you. I will do that and add it to a v5.




More information about the pve-devel mailing list