This was not only rather inefficient (getting the config from the
archive twice) but also wrong, as we can override options on restore,
so we can do the check only when the backed-up config and override
config got merged.
If this is to late from POV of volume deletion or the like, then the
issue is that those things happen to early, as we can only know what
to do with the actual target config, so destructive actions that
happen before that are wrong by design.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
'backup',
);
- my $vzdump_conf = PVE::Storage::extract_vzdump_config($storecfg, $archive);
- my $backup_conf = PVE::QemuServer::parse_vm_config("restore/qemu-server/$vmid.conf", $vzdump_conf, 1);
- PVE::QemuServer::check_bridge_access($rpcenv, $authuser, $backup_conf);
-
$archive = $parse_restore_archive->($storecfg, $archive);
}
}
}
my $new_conf = $restore_merge_config->($conffile, $new_conf_raw, $options->{override_conf});
+ check_bridge_access($rpcenv, $user, $new_conf);
PVE::QemuConfig->write_config($vmid, $new_conf);
eval { rescan($vmid, 1); };
}
my $new_conf = $restore_merge_config->($conffile, $new_conf_raw, $opts->{override_conf});
+ check_bridge_access($rpcenv, $user, $new_conf);
PVE::QemuConfig->write_config($vmid, $new_conf);
eval { rescan($vmid, 1); };