+ } elsif ($et eq 'pool') {
+ my ($pathtxt, $comment, $vmlist, $storelist) = @data;
+
+ if (my $path = normalize_path($pathtxt)) {
+ # make sure to add the pool (even if there are no members)
+ $cfg->{pools}->{$path} = { vms => {}, storage => {} } if !$cfg->{pools}->{$path};
+
+ $cfg->{pools}->{$path}->{comment} = PVE::Tools::decode_text($comment) if $comment;
+
+ foreach my $vmid (split_list($vmlist)) {
+ if ($vmid !~ m/^\d+$/) {
+ warn "user config - ignore invalid vmid '$vmid' in pool '$path'\n";
+ next;
+ }
+ $vmid = int($vmid);
+
+ if ($cfg->{vms}->{$vmid}) {
+ warn "user config - ignore duplicate vmid '$vmid' in pool '$path'\n";
+ next;
+ }
+
+ $cfg->{pools}->{$path}->{vms}->{$vmid} = 1;
+
+ # record vmid ==> pool relation
+ $cfg->{vms}->{$vmid} = $path;
+ }
+
+ foreach my $storeid (split_list($storelist)) {
+ if ($storeid !~ m/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i) {
+ warn "user config - ignore invalid storage '$storeid' in pool '$path'\n";
+ next;
+ }
+ $cfg->{pools}->{$path}->{storage}->{$storeid} = 1;
+ }
+
+ } else {
+ warn "user config - ignore invalid path in pool'$pathtxt'\n";
+ }