public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: [pve-devel] applied-series: [PATCH qemu-server 1/2] migrate: add log for guest fstrim
Date: Tue, 26 Apr 2022 12:16:08 +0200	[thread overview]
Message-ID: <1650966361.6lu2wu8d3q.astroid@nora.none> (raw)
In-Reply-To: <20220425123112.37261-1-f.ebner@proxmox.com>

thanks!

On April 25, 2022 2:31 pm, Fabian Ebner wrote:
> and make a failure noticable.
> 
> Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  PVE/QemuMigrate.pm | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 891edfb2..c293e294 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -1170,14 +1170,23 @@ sub phase3_cleanup {
>  		    $self->{errors} = 1;
>  		}
>  	    }
> +	}
>  
> -	    if (
> -		$self->{storage_migration}
> -		&& PVE::QemuServer::parse_guest_agent($conf)->{fstrim_cloned_disks}
> -		&& $self->{running}
> -	    ) {
> +	if (
> +	    $self->{storage_migration}
> +	    && PVE::QemuServer::parse_guest_agent($conf)->{fstrim_cloned_disks}
> +	    && $self->{running}
> +	) {
> +	    if (!$self->{vm_was_paused}) {
> +		$self->log('info', "issuing guest fstrim");
>  		my $cmd = [@{$self->{rem_ssh}}, 'qm', 'guest', 'cmd', $vmid, 'fstrim'];
> -		eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
> +		eval { PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
> +		if (my $err = $@) {
> +		    $self->log('err', "fstrim failed - $err");
> +		    $self->{errors} = 1;
> +		}
> +	    } else {
> +		$self->log('info', "skipping guest fstrim, because VM is paused");
>  	    }
>  	}
>      }
> -- 
> 2.30.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




      parent reply	other threads:[~2022-04-26 10:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 12:31 [pve-devel] " Fabian Ebner
2022-04-25 12:31 ` [pve-devel] [PATCH qemu-server 2/2] migrate: resume initially running VM when failing after convergence Fabian Ebner
2022-04-26 10:16 ` Fabian Grünbichler [this message]

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=1650966361.6lu2wu8d3q.astroid@nora.none \
    --to=f.gruenbichler@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