From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 536091FF16E for ; Mon, 9 Dec 2024 17:47:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D7A8C98DF; Mon, 9 Dec 2024 17:47:36 +0100 (CET) Date: Mon, 9 Dec 2024 15:00:31 +0100 To: pve-devel@lists.proxmox.com References: <20241126151957.10072-1-fabio.fantoni@m2r.biz> In-Reply-To: <20241126151957.10072-1-fabio.fantoni@m2r.biz> X-Mailman-Approved-At: Mon, 09 Dec 2024 17:47:34 +0100 MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Fabio Fantoni via pve-devel Precedence: list Cc: Fabio Fantoni X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: Re: [pve-devel] [PATCH qemu-server] fix vm shutdown when agent conf is enabled but is not running in the vm Content-Type: multipart/mixed; boundary="===============0238736662979253201==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============0238736662979253201== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id D5150C19B8 for ; Mon, 9 Dec 2024 15:00:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B1AD65120 for ; Mon, 9 Dec 2024 15:00:43 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 9 Dec 2024 15:00:42 +0100 (CET) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d3cf094768so4431486a12.0 for ; Mon, 09 Dec 2024 06:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=m2r-biz.20230601.gappssmtp.com; s=20230601; t=1733752836; x=1734357636; darn=lists.proxmox.com; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1huTtjQiQmGC6TO1r/qc4kHMZtAkhOrkKKdh6rVDacE=; b=QaWq0SohACrgjDQzW3VFwUySR4vCPeIjEbgCs06RvSysnoSt7ylUHNO0alEMkQtb3l EKYxKbJOT0yiHpz8YiT0yKVyFZXhyLyFq+D8P6WM2XUoH6ZzPH6OGFIP1WRlAa0WYH1+ eB9OcCb7u239TnRUsJQE/uLgUplP7X9+iRoWWH5xG5TTIMGyrtuj4Mlr2IxAwO/Zia3H yFR0xmy33U8IP0+g3QclLXYv8A6lqpM5U+7rbm2j9/hpyZS26hQwleWU3MJgr7wRv92a agpwOkIibSLX01ZFQgNbipOWwjyfRsBUtR5L/TByuE3fJDkAvrHjqHu3W5ArIx2B0H/5 Q7dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733752836; x=1734357636; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1huTtjQiQmGC6TO1r/qc4kHMZtAkhOrkKKdh6rVDacE=; b=UKzU2S9/zLZL6MpE5/TqeSgEnrdwKDgLjoV3/UHTuxJp9hjoBGoQSLpx5ZnmSkHGFM SvgAPt3sDaUvTVzwMK4skCduh6ERmg4/op0ue0oMLekmswc6bO5uj51xamB46+sw02AJ C+4mNufaYhc9UWN8FbeUa5dgkzKwHfQYSrr02GTAvU6hr8sOHQfNgH1ZHjRNqUs+BMjY NADXSKAns5g+lUBHehUN+vPh5Yfaf59ox4uk03v2Il5r+ARocd1oKpZx5hOx9+oV3Bhm 4sz+kIO4j6oOeSdo2ZCYLVEGD57zn+N6gdojeGLMI379Y/7lKHHEWcog09WCeDH91G0l OZKA== X-Gm-Message-State: AOJu0YztjyF6QtibkH+DaKeQ7Iz9wZfKio9n85jvRjSGC52rPxl2P1I0 DgH+WzYqpWFlCt1ve+p81y0AnohQcIbzQJBgHVKROuA74RB1TYkxq62TfUdm5GhmT2I9+8cVU1+ P X-Gm-Gg: ASbGncs3EovUk3me9HspAyAm93R0L32cnEOFYbFSrSuOQoEwqYpRB0WKtiag9U6fc2x Ox0ILyukyWlCMlY0zgFJShm+0Dqt2xOQIJg06SOb02xQyqJuGUCB2RJ/APPfdyVZOeEeMBAENZk ouWU8pngFBrxjlRTfrgKqqRRHNktbPdqMI/h+4tUN1IhPbypp6hp0daj366BubOaGHnyv1jVByH 4eHAxKBddoXRkG6gosQh8kQMlXOyZaIVb/ltrdyiw6+Uzhy5ufhhMHWE+RkglnBtYgtK/hUfef5 jGmb1uIiCWh5h6Qy6cvjloBPD2poSaFwdqxDjA== X-Google-Smtp-Source: AGHT+IGChkYFtn55bUD8QT/xx1AZSpC7z093FdUq0Q4VlxY+kvUwPNfNqwXmurkEKm+gUv+5eLmZPA== X-Received: by 2002:a05:6402:5194:b0:5d1:2377:5afc with SMTP id 4fb4d7f45d1cf-5d418502c8amr889054a12.3.1733752834074; Mon, 09 Dec 2024 06:00:34 -0800 (PST) Received: from [192.168.178.27] (host-79-45-87-243.retail.telecomitalia.it. [79.45.87.243]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48a38sm6163852a12.23.2024.12.09.06.00.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 06:00:33 -0800 (PST) Message-ID: Date: Mon, 9 Dec 2024 15:00:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server] fix vm shutdown when agent conf is enabled but is not running in the vm Content-Language: it To: pve-devel@lists.proxmox.com References: <20241126151957.10072-1-fabio.fantoni@m2r.biz> From: Fabio Fantoni In-Reply-To: <20241126151957.10072-1-fabio.fantoni@m2r.biz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Antivirus: Avast (VPS 241209-2, 9/12/2024), Outbound message X-Antivirus-Status: Clean X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DMARC_PASS -0.1 DMARC pass policy JMQ_SPF_NEUTRAL 0.5 SPF set to ?all KAM_INFOUSMEBIZ 0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-Mailman-Approved-At: Mon, 09 Dec 2024 17:47:34 +0100 Ping Il 26/11/2024 16:19, Fabio Fantoni ha scritto: > 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 > --- > 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_ru= nning($vmid, 1)) { > mon_cmd($vmid, "guest-shutdown", timeout =3D> $timeout); > } else { > mon_cmd($vmid, "system_powerdown"); -- Questa email =C3=A8 stata esaminata alla ricerca di virus dal software anti= virus Avast. www.avast.com --===============0238736662979253201== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============0238736662979253201==--