qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/1] add exit-script option to qemu


From: Dominik Csapak
Subject: Re: [Qemu-devel] [PATCH 0/1] add exit-script option to qemu
Date: Fri, 5 Oct 2018 08:56:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 10/4/18 3:51 PM, Daniel P. Berrangé wrote:
On Wed, Oct 03, 2018 at 11:13:43AM +0200, Dominik Csapak wrote:
this patch aims to execute a script when qemu exits
so that one can do cleanups when using --daemonize without
having to use the qmp monitor

IMHO the idea of cleanup scripts run by QEMU itself is flawed.
QEMU will inevitably crash before cleanup scripts can be run,
so whatever mgmt app is using QEMU needs to be able to do
cleanup without QEMU's help.

I think this can be done more reliably with a wrapper script,
that spawns QEMU, waits for it to exit and then calls the
cleanup script. On Linux at least you can use prctl() with
PR_SET_CHILD_SUBREAPER so you can detect exit'ing of QEMU
even after it has daemonized.

Perhaps we could have such a wrapper script put in the
contrib directory

Regards,
Daniel

Hi,

for cleaning up after qemu crashes, you are completely right,
(ignoring that the downscript for tap devices also never gets executed
then), but this series has another use.

With it, a user can determine the reason of a graceful shutdown
(e.g., if it was by a signal, qmp or from inside) of qemu,
especially when using -no-reboot without using qmp

and using qmp for that is not very practical for everyone,
or is there another way for that which i am missing?

Regards,
Dominik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]