Am 14.10.25 um 2:27 PM schrieb Maximiliano Sandoval:
> This is used when performing a full-clone of a running VM.
>
> Signed-off-by: Maximiliano Sandoval <[email protected]>
> ---
> src/PVE/QemuServer/BlockJob.pm | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm
> index 506010e1..5a4b416e 100644
> --- a/src/PVE/QemuServer/BlockJob.pm
> +++ b/src/PVE/QemuServer/BlockJob.pm
> @@ -162,8 +162,11 @@ sub qemu_drive_mirror_monitor {
> last if $completion eq 'skip' || $completion eq 'auto';
>
> if ($vmiddst && $vmiddst != $vmid) {
> + my $config = PVE::QemuConfig->load_config($vmid);
Not a huge fan of loading the config this deep into a worker. That's not
something usually done in our code base. Maybe we should rename the $qga
param to indicate that it's specific to freeze and already check the
config on the call sites (and also log there if skipped because disabled).
We can still do a final check here if the guest agent is actually
running and warn if not.
> + my $fsfreeze =
> + PVE::QemuServer::Agent::get_qga_key($config,
> 'guest-fsfreeze') // 1;
> my $agent_running = $qga && qga_check_running($vmid);
> - if ($agent_running) {
> + if ($agent_running && $fsfreeze) {
> print "freeze filesystem\n";
> eval {
> PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
> warn $@ if $@;
> @@ -176,7 +179,7 @@ sub qemu_drive_mirror_monitor {
> # if we clone a disk for a new target vm, we don't
> switch the disk
> qemu_blockjobs_cancel($vmid, $jobs);
>
> - if ($agent_running) {
> + if ($agent_running && $fsfreeze) {
> print "unfreeze filesystem\n";
> eval { mon_cmd($vmid, "guest-fsfreeze-thaw"); };
> warn $@ if $@;
_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel