[PATCH qemu-server 2/2] backup: log backup start via QMP command to avoid confusion about freeze/thaw

Fiona Ebner
2026-03-26T11:33:09Z

Curently, a backup task log looks like:

> INFO: issuing guest-agent 'fs-freeze' command
> INFO: issuing guest-agent 'fs-thaw' command
> INFO: started backup task 'beebb719-bdb8-4de8-9d34-5cbf182cea3e'

or in case of a failure during backup start:

> INFO: issuing guest-agent 'fs-freeze' command
> INFO: issuing guest-agent 'fs-thaw' command
> ERROR: VM 100 qmp command 'backup' failed - <error message from QEMU>

Both might suggest that the thaw operation and starting the backup
happen in the wrong order, which can lead to confusion. Add a log line
when issuing the 'backup' QMP command to clarify that this is not the
case.

After the patch, the task logs look like:

> INFO: issuing guest-agent 'fs-freeze' command
> INFO: starting backup via QMP command
> INFO: issuing guest-agent 'fs-thaw' command
> INFO: started backup task 'e4e961c1-661b-4971-aefb-6715fd6a0d70'

or in case of a failure during backup start:

> INFO: issuing guest-agent 'fs-freeze' command
> INFO: starting backup via QMP command
> INFO: issuing guest-agent 'fs-thaw' command
> ERROR: VM 100 qmp command 'backup' failed - <error message from QEMU>

In case of provider-based backups, there already is a log-message
between freeze and thaw:

> INFO: issuing guest-agent 'fs-freeze' command
> INFO: setting up snapshot-access for backup
> INFO: issuing guest-agent 'fs-thaw' command

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/VZDump/QemuServer.pm | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/PVE/VZDump/QemuServer.pm b/src/PVE/VZDump/QemuServer.pm
index 2d55fbfa..cdf20219 100644
--- a/src/PVE/VZDump/QemuServer.pm
+++ b/src/PVE/VZDump/QemuServer.pm
@@ -841,6 +841,7 @@ sub archive_pbs {

$params->{timeout} = 125; # give some time to connect to the backup server

+ $self->loginfo("starting backup via QMP command");
my $res = eval { mon_cmd($vmid, "backup", %$params) };
my $qmperr = $@;
$backup_job_uuid = $res->{UUID} if $res;
@@ -1024,6 +1025,7 @@ sub archive_vma {

my $fs_frozen = $self->qga_fs_freeze($task, $vmid);

+ $self->loginfo("starting backup via QMP command");
eval { $qmpclient->queue_execute(30) };
my $qmperr = $@;

--
2.47.3