* [pve-devel] [PATCH manager] vzdump: included_guest: return empty hash if no guests selected
@ 2020-07-09 11:21 Aaron Lauterer
2020-07-09 11:34 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2020-07-09 11:21 UTC (permalink / raw)
To: pve-devel
This will fix the behaviour when calling `vzdump --stop` to cause all
local guests to be backed up.
When refactoring this logic in commit be308647, the assumption was that
every call will have one of the following parameters set: pool, list of
VMIDs or all (intentional or when exclude is used).
There is an addtional possibility, that vzdump is called with only
--stop. Thus there are no other parameters that would indicate which
VMIDs to include.
In this case we want to return the empty hash.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
PVE/VZDump.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 1f0eb246..601cd56e 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -1170,7 +1170,7 @@ sub get_included_guests {
$vmids = PVE::API2Tools::get_resource_pool_guest_members($job->{pool});
} elsif ($job->{vmid}) {
$vmids = [ split_list($job->{vmid}) ];
- } else {
+ } elsif ($job->{all}) {
# all or exclude
my $exclude = check_vmids(split_list($job->{exclude}));
my $excludehash = { map { $_ => 1 } @$exclude };
@@ -1179,6 +1179,8 @@ sub get_included_guests {
next if $excludehash->{$id};
push @$vmids, $id;
}
+ } else {
+ return $vmids_per_node;
}
$vmids = check_vmids(@$vmids);
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: Re: [PATCH manager] vzdump: included_guest: return empty hash if no guests selected
2020-07-09 11:21 [pve-devel] [PATCH manager] vzdump: included_guest: return empty hash if no guests selected Aaron Lauterer
@ 2020-07-09 11:34 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-07-09 11:34 UTC (permalink / raw)
To: Proxmox VE development discussion, Aaron Lauterer
On 09.07.20 13:21, Aaron Lauterer wrote:
> This will fix the behaviour when calling `vzdump --stop` to cause all
> local guests to be backed up.
>
> When refactoring this logic in commit be308647, the assumption was that
> every call will have one of the following parameters set: pool, list of
> VMIDs or all (intentional or when exclude is used).
>
> There is an addtional possibility, that vzdump is called with only
> --stop. Thus there are no other parameters that would indicate which
> VMIDs to include.
>
> In this case we want to return the empty hash.
>
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> ---
> PVE/VZDump.pm | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-09 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 11:21 [pve-devel] [PATCH manager] vzdump: included_guest: return empty hash if no guests selected Aaron Lauterer
2020-07-09 11:34 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox