public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Cc: Fabio Fantoni <fabio.fantoni@m2r.biz>
Subject: [pve-devel] applied: [PATCH qemu-server] fix vm shutdown when agent conf is enabled but is not running in the vm
Date: Tue, 17 Dec 2024 13:59:33 +0100	[thread overview]
Message-ID: <89f4953c-8519-4b3a-a9c7-b506165ea514@proxmox.com> (raw)
In-Reply-To: <mailman.735.1732635748.391.pve-devel@lists.proxmox.com>

Am 26.11.24 um 16:19 schrieb Fabio Fantoni via pve-devel:
> Checking only vm configuration for choose the shutdown method causes it
> to always fail, after reaching the timeout, if the qemu agent option in
> the vm configuration is enabled but the agent is not installed and
> active in the guest.
> As I seen in the windows vm the agent also crashes in some cases, so
> shutdown don't fail only if qemu guest agent is not installed or not
> started.
> 
> Added check that agent is active when choosing agent shutdown method to
> avoid certain shutdown failure in those cases.
> 
> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>

applied, thanks! But I made a change to not set the $nowarn flag. If the
agent is configured, but not running, I do think a warning makes sense
for informational and debugging purposes.

> ---
>  PVE/QemuServer.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 2046a7c..4b6aac7 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -6341,7 +6341,7 @@ sub _do_vm_stop {
>  
>      eval {
>  	if ($shutdown) {
> -	    if (defined($conf) && get_qga_key($conf, 'enabled')) {
> +	    if (defined($conf) && get_qga_key($conf, 'enabled') && qga_check_running($vmid, 1)) {
>  		mon_cmd($vmid, "guest-shutdown", timeout => $timeout);
>  	    } else {
>  		mon_cmd($vmid, "system_powerdown");
> -- 
> 2.25.1
> 
> 



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


      reply	other threads:[~2024-12-17 12:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-26 15:19 [pve-devel] " Fabio Fantoni via pve-devel
2024-12-17 12:59 ` Fiona Ebner [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=89f4953c-8519-4b3a-a9c7-b506165ea514@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=fabio.fantoni@m2r.biz \
    --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