public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Cc: "pve-devel" <pve-devel-bounces@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server v2 1/6] add a guest-fsfreeze qga setting
Date: Tue, 02 Sep 2025 16:43:19 +0200	[thread overview]
Message-ID: <DCIE7BCAWV8A.1YHPE3TT1YIY6@proxmox.com> (raw)
In-Reply-To: <20250902124524.368080-2-m.sandoval@proxmox.com>

On Tue Sep 2, 2025 at 2:45 PM CEST, Maximiliano Sandoval wrote:
> Adds a new setting that controls whether guest-fsfreeze-{freeze,thaw}
> commands should be issued. The previous setting was only taken into
> account for backups.
>
> In this commit we only use this setting for backups. The following two
> commits will ensure the setting is used on replications, snapshots and
> clones.
>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
>  src/PVE/QemuServer.pm        | 11 +++++++++++
>  src/PVE/VZDump/QemuServer.pm |  6 +++++-
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index f263fedb..cdd44eb0 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -167,6 +167,17 @@ my $agent_fmt = {
>          optional => 1,
>          default => 1,
>      },
> +    'guest-fsfreeze' => {
> +        description =>
> +            "Whether to issue the guest-fsfreeze-freeze and guest-fsfreeze-thaw QEMU guest agent commands.\n\n"
> +            . "Backups in snapshot mode, clones, snapshots without RAM, and replications normally issue a "
> +            . "fsfreeze-fsfreeze-freeze and a respective thaw command when the QEMU Guest agent option is "
> +            . "enabled on the guest's configuration and the agent is running inside of the guest.\n\n"
> +            . "Takes preference over 'freeze-fs-on-backup' when set.",

'Takes preference over' should be 'Takes precedence over'.

nit: But I think it'd be easier for users to understand something like

    When this property/option is set, it will override the setting of
    'freeze-fs-on-backup'.

> +        type => 'boolean',
> +        optional => 1,
> +        default => 1,
> +    },
>      type => {
>          description => "Select the agent type",
>          type => 'string',
> diff --git a/src/PVE/VZDump/QemuServer.pm b/src/PVE/VZDump/QemuServer.pm
> index 5b94c369..2879639a 100644
> --- a/src/PVE/VZDump/QemuServer.pm
> +++ b/src/PVE/VZDump/QemuServer.pm
> @@ -1096,7 +1096,11 @@ sub qga_fs_freeze {
>          return;
>      }
>  
> -    my $freeze = PVE::QemuServer::get_qga_key($self->{vmlist}->{$vmid}, 'freeze-fs-on-backup') // 1;
> +    my $freze_fs_on_backup =

s/freze/freeze/

> +        PVE::QemuServer::get_qga_key($self->{vmlist}->{$vmid}, 'freeze-fs-on-backup');
> +    my $guest_fsfreeze = PVE::QemuServer::get_qga_key($self->{vmlist}->{$vmid}, 'guest-fsfreeze');
> +
> +    my $freeze = $guest_fsfreeze // $freze_fs_on_backup // 1;

could also just be

    my $freeze = PVE::QemuServer::get_qga_key($self->{vmlist}->{$vmid}, 'guest-fsfreeze');
    $freeze //= PVE::QemuServer::get_qga_key($self->{vmlist}->{$vmid}, 'freeze-fs-on-backup');
    $freeze //= 1;

or something like that to not have unnecessary temporary variables.

>      if (!$freeze) {
>          $self->loginfo("skipping guest-agent 'fs-freeze', disabled in VM options");
>          return;



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-09-02 14:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 12:45 [pve-devel] [PATCH container/guest-common/qemu-server v2 0/8] fix #1964: Add a setting to globally disable freezing a guest Maximiliano Sandoval
2025-09-02 12:45 ` [pve-devel] [PATCH qemu-server v2 1/6] add a guest-fsfreeze qga setting Maximiliano Sandoval
2025-09-02 14:43   ` Daniel Kral [this message]
2025-09-02 12:45 ` [pve-devel] [PATCH qemu-server v2 2/6] block job: mirror: follow guest-fsfreeze setting Maximiliano Sandoval
2025-09-02 12:45 ` [pve-devel] [PATCH qemu-server v2 3/6] fix #1964: follow guest-fsfreeze setting on check freeze needed Maximiliano Sandoval
2025-09-02 12:45 ` [pve-devel] [PATCH qemu-server v2 4/6] log when issuing a guest-fsfreeze command Maximiliano Sandoval
2025-09-02 14:47   ` Daniel Kral
2025-09-02 12:45 ` [pve-devel] [PATCH qemu-server v2 5/6] block job: mirror: reword fsfreeze log entry Maximiliano Sandoval
2025-09-02 12:45 ` [pve-devel] [PATCH qemu-server v2 6/6] deprecate freeze-fs-on-backup qga setting Maximiliano Sandoval
2025-09-02 14:47   ` Daniel Kral
2025-09-02 12:45 ` [pve-devel] [PATCH container v2 1/1] log when freezing/thawing filesystem Maximiliano Sandoval
2025-09-02 12:45 ` [pve-devel] [PATCH guest-common v2 1/1] replication: remove logging when freezing/thawing Maximiliano Sandoval
2025-09-02 15:36 ` [pve-devel] [PATCH container/guest-common/qemu-server v2 0/8] fix #1964: Add a setting to globally disable freezing a guest Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DCIE7BCAWV8A.1YHPE3TT1YIY6@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=pve-devel-bounces@lists.proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal