On November 12, 2024 3:35 pm, Fiona Ebner wrote: > On 12.11.24 1:27 PM, Fabian Grünbichler wrote: >> On November 7, 2024 5:51 pm, Fiona Ebner wrote: >>> + my $backup_access_info = eval { mon_cmd($vmid, "backup-access-setup", >>> $params->%*) }; >>> + my $qmperr = $@; >>> + >>> + $task->{cleanup}->{'backup-access-teardown'} = { 'target-id' => >>> $target_id, success => 0 }; >> >> should we differentiate here between setup success or failure? if not, >> should we move it directly before the setup call? >> > > No, there should be no differentiation. The teardown QMP command needs > to be called in any case. But how could it happen that we do reach > cleanup but haven't gotten through here after the setup call? The setup > call is in an eval and there is nothing that can die in between. I can > still move it if you feel that is cleaner.
yeah, this is mostly about other stuff being added in-between later on. probably not too likely in this case, but I always prefer setting a cleanup-potentially-required flag *before* doing the thing that potentially requires cleanup, rather than after (even if the current code does everything right). it's the safer variant (even though it of course also has potential for stuff being added in-between, and then triggering cleanup without the cleanup-source actually having happened ;)) _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel