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

Jean-Francois Dagenais jeff.dagenais at gmail.com
Thu Mar 3 15:05:52 CET 2016


> 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"?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20160303/3b1a4730/attachment.sig>


More information about the pve-devel mailing list