[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] libxl: wait for QEMU exit before restarting a domain
- To: Jan Beulich <jbeulich@xxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
- From: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>
- Date: Tue, 10 Nov 2026 17:10:43 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=95lf+0J6m1H5yD3wWpgCi8OODwf5CsVuGNVDqxrdsns=; b=Wy77r+bYMGIFQZD1QtaLzDHxDwxQkI1JUCE4veqyZrTdCES2Vf2OlDSSBQPzSuUlTiENASKQnME2E+YeGCwB615D4zMvPoZzcRW8vzuKTfzRriLa+CSgJQEm/xursJ+ZizChNIclCy/PriJui3Avhcw8ia1Ye7A57QcZY6A7TC+CkABFoOS/Sk4BkVFF2hc+ihQ9uFhF+XIv8sYZ06EYoB3gk/0WKRr3gtGItPpusYloCWoF8qdZngaM9gwIwS9ETdN7ZHkRgLSrWB+Rd0p4DZ8ZuFSThEATG9ZRYy6L5ojHSKDVBEc/3+2saeNeyAFgs1fVon9Xn9iQ/vyt51TIeA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IWlpyVelxMIx5Uc2UdPW2Jrl23sPGF0cqxjvsRmYcihbfZ9ZzH6m3t0WewRPsUEcux7YvOiE1t1OiRAaODsYqUZiLXyg8cjzh6cfzsFPn8G4M+xX+u/B/O+f8LqBQ3M3XW8Jd6lrnRYRuA+AexDtNhWmNvCS0n65ZtD+Cv/FvwgipHpIUMNsNRuLKdo0e0D+P75Kllr5zBA4q53MhvtfJFQajYIdcykbKHDTUuVzCTUnCd/HuybrV1/b76UMO/j7arWI4EJCWKyb81eFL+egJvY+bHeax8ADv8DkWT7JSzmFFs+kyFz4Ubr3Js5kExaWdZwPBi+qMh5t7w3dIEuldQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Penny Zheng <penny.zheng@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 10 Nov 2026 09:11:04 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2026-11-05 16:13, Jan Beulich wrote:
> On 04.11.2026 18:33, Jason Andryuk wrote:
>> On 2026-11-04 01:46, Jiaqing Zhao wrote:
>>> The PID-based device model destruction path returns immediately after
>>> sending SIGHUP, before QEMU has necessarily exited. When an HVM guest
>>> reboots with VNC enabled, the new QEMU process may fail to bind the VNC
>>> port because the old process still holds it.
>>>
>>> Wait for QEMU to exit in a child process after singaling it for at most
>>
>> "signaling"
>>
>>> 60 seconds. If waiting fails or times out, log the error and retain the
>>> existing domain destruction behaviour.
>>
>> 60 seconds seems like a lot. Did you measure the time to see how long
>> it takes? It's an upper bound, but maybe 10 seconds would be better?
>
> Is 10s enough for it to time out upon disconnecting pass-through devices?
> I'm seeing this happen routinely, albeit with an older version of qemu.
>
> Jan
I checked the code, passthorugh devices are removed via QMP, with
pci_remove_qmp_query_cb(), before sending SIGHUP to terminate QEMU.
Passing through a PCI SD card controller on my system took ~1.2s from
`xl destory` to sending SIGHUP to QEMU, and QEMU then took ~50ms to exit.
So 10s is pretty enough here I think.
|