mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-27 23:09:01 +00:00
api: clone vm: comment and style clean-up deactivation error-handling
Make the post-if check for the target not already running more prominent by using a full if block. Also comment on why we ignore the error here, while the commit changing that explained it well, this is one of the things that might be better of with a in-code comment (as doing the deactivation is described as important here, so one might wonder why the code continues if that fails) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
9d6126e8db
commit
04736ecbd5
@ -3820,11 +3820,12 @@ __PACKAGE__->register_method({
|
||||
PVE::QemuServer::create_ifaces_ipams_ips($newconf, $newid);
|
||||
|
||||
if ($target) {
|
||||
# always deactivate volumes - avoid lvm LVs to be active on several nodes
|
||||
eval {
|
||||
PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) if !$running;
|
||||
};
|
||||
log_warn($@) if ($@);
|
||||
if (!$running) {
|
||||
# always deactivate volumes – avoids that LVM LVs are active on several nodes
|
||||
eval { PVE::Storage::deactivate_volumes($storecfg, $vollist, $snapname) };
|
||||
# but only warn when that fails (e.g., parallel clones keeping them active)
|
||||
log_warn($@) if $@;
|
||||
}
|
||||
|
||||
PVE::Storage::deactivate_volumes($storecfg, $newvollist);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user