]> git.proxmox.com Git - pve-manager.git/commit
vzdump: move remaining guest include logic to single method
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 17 Jun 2020 12:13:38 +0000 (14:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 Jun 2020 13:16:06 +0000 (15:16 +0200)
commitdf5875b41e12d164cfe3c722e929f4c41fc94d34
tree77c409916feb98e38c45adc59cfe901dc0379575
parent4aa89cc0e8aef3b7377def9f5ca0b8b83830e3f4
vzdump: move remaining guest include logic to single method

The `guest include` logic handling `all` and `exclude` parameters was in
the `PVE::VZDump->exec_backup()` method. Moving this logic into the
`get_included_guests` method allows us to simplify and generalize it.

This helps to make the overall logic easier to test and develop other
features around vzdump backup jobs.

The method now returns a hash with node names as keys mapped to arrays
of VMIDs on these nodes that are included in the vzdump job.

The VZDump API call to create a new backup is adapted to use the new
method to create the list of local VMIDs and the skiplist.

Permission checks are kept where they are to be able to handle missing
permissions according to the current context. The old behavior to die
on a backup job when the user is missing the permission to a guest and
the job is not an 'all' or 'exclude' job is kept.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
PVE/API2/VZDump.pm
PVE/VZDump.pm