[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/2] vl: fix use of --daemonize with --precon
From: |
Michal Privoznik |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/2] vl: fix use of --daemonize with --preconfig |
Date: |
Mon, 4 Jun 2018 16:21:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 06/04/2018 02:03 PM, Daniel P. Berrangé wrote:
> When using --daemonize, the initial lead process will fork a child and
> then wait to be notified that setup is complete via a pipe, before it
> exits. When using --preconfig there is an extra call to main_loop()
> before the notification is done from os_setup_post(). Thus the parent
> process won't exit until the mgmt application connects to the monitor
> and tells QEMU to leave the RUN_STATE_PRECONFIG. The mgmt application
> won't connect to the monitor until daemonizing has completed though.
>
> This is a chicken and egg problem, leading to deadlock at startup.
>
> The only viable way to fix this is to call os_setup_post() before
> the early main_loop() call when in RUN_STATE_PRECONFIG. This has the
> downside that any errors from this point onwards won't be handled
> well by the mgmt application, because it will think QEMU has started
> successfully, so not be expecting an abrupt exit. The only way to
> deal with that is to move as much user input validation as possible
> to before the main_loop() call. This is left as an exercise for
> future interested developers.
>
> Signed-off-by: Daniel P. Berrangé <address@hidden>
> ---
> vl.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
Yup, this fixes the problem I've raised in my patch. Thanks!
Reviewed-by: Michal Privoznik <address@hidden>
(if my R-b line means anything here :-))
Michal
Re: [Qemu-devel] [PATCH v2 1/2] vl: don't use RUN_STATE_PRECONFIG as initial state, Igor Mammedov, 2018/06/04
Re: [Qemu-devel] [PATCH v2 1/2] vl: don't use RUN_STATE_PRECONFIG as initial state, Daniel P . Berrangé, 2018/06/05
[Qemu-devel] [PATCH v2 2/2] vl: fix use of --daemonize with --preconfig, Daniel P . Berrangé, 2018/06/04
Re: [Qemu-devel] [PATCH v2 2/2] vl: fix use of --daemonize with --preconfig, Igor Mammedov, 2018/06/04
Re: [Qemu-devel] [PATCH v2 0/2] Avoid using RUN_STATE_PRECONFIG unless explicitly requested with --preconfig, Michal Prívozník, 2018/06/11