Am 30.12.25 um 4:32 PM schrieb Maximiliano Sandoval:
> Fiona Ebner <[email protected]> writes:
> 
>> Am 14.10.25 um 2:27 PM schrieb Maximiliano Sandoval:
>>> These messages appear during replication or snapshots.
>>>
>>> The messages will now appear on all call sites of __snapshot_freeze().
>>>
>>> Signed-off-by: Maximiliano Sandoval <[email protected]>
>>> ---
>>>  src/PVE/QemuConfig.pm | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
>>> index 412c76ae..32a95dd6 100644
>>> --- a/src/PVE/QemuConfig.pm
>>> +++ b/src/PVE/QemuConfig.pm
>>> @@ -310,9 +310,11 @@ sub __snapshot_freeze {
>>>      my ($class, $vmid, $unfreeze) = @_;
>>>  
>>>      if ($unfreeze) {
>>> +        print "issuing guest agent 'guest-fsfreeze-thaw' command\n";
>>>          eval { mon_cmd($vmid, "guest-fsfreeze-thaw"); };
>>>          warn "guest-fsfreeze-thaw problems - $@" if $@;
>>>      } else {
>>> +        print "issuing guest agent 'guest-fsfreeze-freeze' command\n";
>>>          eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
>>>          warn $@ if $@;
>>>      }
>>
>> Maybe there should be a PVE::QemuServer::Agent::guest_fsthaw() helper
>> and the messages should go into the Agent::guest_fs{freeze,thaw}()
>> helpers directly rather than on all call sites. Avoids duplication and
>> improves consistency.
> 
> The problem is that half of the users would prefer to log with a logging
> function, adding a `$logfunc` parameter to these two helpers can be OK,
> but it also requires changes in LXC.pm. 

As discussed off-list, the complication here is the caller of
__snapshot_freeze in pve-guest-common/Replication.pm which uses a
dedicated $logfunc which would need to be passed along. I wasn't aware
of this when proposing the change, so please just go ahead with the rest :)


_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to