From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 8627C1FF09B for ; Mon, 17 Aug 2026 16:52:13 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 904AE214B3; Mon, 17 Aug 2026 16:52:12 +0200 (CEST) Message-ID: <5abba171-35e8-4607-8c21-331aee839e11@proxmox.com> Date: Mon, 17 Aug 2026 16:52:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server v2 0/1] fix #7590: apply timeout to QEMU start fork To: pve-devel@lists.proxmox.com References: <20260803172152.331208-1-s.rufinatscha@proxmox.com> Content-Language: en-US From: Samuel Rufinatscha In-Reply-To: <20260803172152.331208-1-s.rufinatscha@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.500 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_ASCII_DIVIDERS 0.8 Email that uses ascii formatting dividers and possible spam tricks KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: BONWJKS7COY5ZVOA6ZC2NLFQICY35ETM X-Message-ID-Hash: BONWJKS7COY5ZVOA6ZC2NLFQICY35ETM X-MailFrom: s.rufinatscha@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi all, I also tested timeout cleanup followed by a successful start and stop with raw and qcow2 TPM state volumes on a temporary directory storage. The qcow2 setup used the QSD + FUSE path. The relevant helper processes and the VM scope were removed and the VM configuration lock was released for both TPM cases. On 8/3/26 7:21 PM, Samuel Rufinatscha wrote: > The qmstart task forks a child process that enters the VM scope, starts > the helper processes and launches QEMU. qmstart then waits for the > child to report success or failure. While regular starts already apply > $start_timeout to the QEMU command, the wait for the forked child has > no timeout. Statefile starts do not use the QEMU command timeout > either, leaving both waits unbounded. > > Timeout handling currently: > > Start type QEMU command timeout forked startup timeout > ------------------------------------------------------------------------------ > regular $start_timeout none > statefile none none > > Timeout handling after this series: > > Start type QEMU command timeout fork startup timeout > ------------------------------------------------------------------------------ > regular $start_timeout 2 * $start_timeout (account for helpers) > statefile with --timeout N none N > statefile without --timeout none 24 hours (as fallback) > > Regular starts retain the existing QEMU command timeout and is twice > for the outer timeout to account for VM scope and helper setup. > Statefile starts continue to have no separate QEMU > command timeout. If --timeout N is specified, N is used as the deadline > for the complete forked startup, otherwise a 24 hour fallback is used. > Values can be changed if needed. > > Tested on a PVE 9.2 node: > - the statefile/FIFO timeout released the configuration lock and left > no QEMU process or VM scope behind, using the reproducer from [1] > - the existing regular QEMU timeout still fired before the outer > safeguard > - an immediate QEMU startup error performed the same scope cleanup > - successful startup and shutdown continued to work > > Note: the separate D-state waitpid() FIXME in > run_fork_with_timeout() [2] concerns the timeout handling itself > potentially blocking indefinitely and is therefore out of scope for > this series. > > [0] https://lore.proxmox.com/pve-devel/20260625114500.159384-1-s.rufinatscha@proxmox.com/ > [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7590 > [2] https://git.proxmox.com/?p=pve-common.git;a=blob;f=src/PVE/Tools.pm;h=8e7646dea43e092fc9ec76b493b418a7ca0eaee2;hb=5054082fe492429fc37574985c2ca812af9a3125#l604 > > Samuel Rufinatscha (1): > fix #7590: qemu-server: apply timeout to QEMU start fork > > src/PVE/QemuServer.pm | 93 +++++++++++++++++++++++++++++++++++-------- > 1 file changed, 77 insertions(+), 16 deletions(-) >