All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Anthony PERARD" <anthony.perard@vates.tech>,
	"Juergen Gross" <jgross@suse.com>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Penny Zheng" <penny.zheng@amd.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] libxl: wait for QEMU exit before restarting a domain
Date: Wed, 11 Nov 2026 13:51:52 +0800	[thread overview]
Message-ID: <81087fde-407a-4f3a-8a7f-e2a96945d175@amd.com> (raw)
In-Reply-To: <d2ef64c7-0587-4fb1-b119-bbd11b987c3a@suse.com>



On 2026-11-10 18:22, Jan Beulich wrote:
> On 10.11.2026 11:02, 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 signaling it for at most
>> 10 seconds. If waiting fails or times out, log the error and retain the
>> existing domain destruction behaviour.
>>
>> Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
>> ---
>> v2:
>> * Share the fork, error handling and child exit handling between UID and
>>   PID-based destruction paths.
>> * Reduce the device-model stop timeout from 60 to 10 seconds.
> 
> As per my v1 comments I continue to question this.

I looked further into QEMU's shutdown path. After receiving SIGHUP,
QEMU calls bdrv_drain_all() to wait for outstanding block I/O requests
and bdrv_flush_all() to flush its block devices. These could take
longer than 10 seconds on slow storage.

While this does not identify the timeout you observed with SR-IOV,
my earlier measurements are insufficient to prove that 10s is enough.
I'll restore the 60s timeout in v3.

>> * Handle unexpected errors from kill(pid, 0) explicitly.
>> * Fix misspelled "signaling" in commit message.
>> * Coding style fixes against tools/libs/light/CODING_STYLE.
>> ---
>> Cc: Anthony PERARD <anthony.perard@vates.tech>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Roger Pau Monné <roger@xenproject.com>
> 
> You will want to use a correct address here (.org rather than .com).
> 
> Jan

That was my mistake, sorry.

By the way, on MAINTAINERS:390, Roger's address uses .com, maybe it need to
be fixed?


  reply	other threads:[~2026-11-11  5:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 10:02 [PATCH v2] libxl: wait for QEMU exit before restarting a domain Jiaqing Zhao
2026-11-10 10:22 ` Jan Beulich
2026-11-11  5:51   ` Jiaqing Zhao [this message]
2026-11-11  6:52     ` Jan Beulich

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=81087fde-407a-4f3a-8a7f-e2a96945d175@amd.com \
    --to=zhao.jiaqing@amd.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=penny.zheng@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.