[pve-devel] vzdump.conf exclude-path parsing

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Mar 3 15:48:40 CET 2016


> On March 3, 2016 at 3:05 PM Jean-Francois Dagenais <jeff.dagenais at gmail.com> wrote:
> 
> 
> 
> > On Mar 3, 2016, at 03:53, Wolfgang Bumiller <w.bumiller at proxmox.com> wrote:
> > 
> >>> Also, the stdexcludes is broken as well. The block starting with "if
> >>> ($opts->{stdexcludes}) {" is not executed even though it should based on the
> >>> fact that I don't mention it and it should therefore default to true.
> > 
> > Not sure what you mean there with "the fact that I don't mention it".
> > I can pass `-stdexcludes`, `-stdexcludes 1` and `-stdexcludes 0` via the
> > command line and use the following in /etc/vzdump.conf:
> >   stdexcludes: 1
> > or
> >   stdexcludes: 0
> 
> According to doc, the default value is that stdexcludes are on by default.
> 
> This means if I don't mention the switch at the cmd line, neither do I mention
> them in vzdump.conf, then stdexcludes should apply... they don't. Basically,
> because of the way the if statement is made, when it's not defined in the hash,
> the if tests as 'false' and stdexcludes are not applied. Here's a small patch
> which seems to fix it well:
> 
> --- a/PVE/VZDump.pm
> +++ b/PVE/VZDump.pm
> @@ -583,6 +583,9 @@ sub new {
>         my @pathlist = split(' ', $defaults->{'exclude-path'});
>         push @$findexcl, @pathlist;
>      }
> +
> +    if (! defined $opts->{stdexcludes}) {
> +       $opts->{stdexcludes} = $confdesc->{stdexcludes}->{default};
>      }
> 
>      if ($opts->{stdexcludes}) {
> 
> 
> Wow, my first perl hack! Do you wish me to send this as a proper "git
> format-patch"?

Nice, thank you but I have another idea in mind that will avoid future
discrepancies between documentation and behavior (patch incoming...)




More information about the pve-devel mailing list