On 7/23/24 17:57, Boris Fiuczynski wrote:
> On 7/22/24 2:01 PM, Jiri Denemark wrote:
>> On Mon, Jul 22, 2024 at 10:55:05 +0200, Michal Prívozník wrote:
>>> On 7/19/24 17:44, Boris Fiuczynski wrote:
>>>> In cases when a QEMU process takes longer than the time sigterm and
>>>> sigkill are issued to kill the process do not simply fail and leave the
>>>> VM in state VIR_DOMAIN_SHUTDOWN until the daemon stops. Instead set up
>>>> an fd on /proc/$pid and get notified when the QEMU process finally has
>>>> terminated to cleanup the VM state.
>>>>
>>>> Resolves: https://issues.redhat.com/browse/RHEL-28819
>>>> Signed-off-by: Boris Fiuczynski <[email protected]>
>>>> ---
>>>> src/qemu/qemu_domain.c | 8 +++
>>>> src/qemu/qemu_domain.h | 2 +
>>>> src/qemu/qemu_driver.c | 18 ++++++
>>>> src/qemu/qemu_process.c | 124
>>>> ++++++++++++++++++++++++++++++++++++++--
>>>> src/qemu/qemu_process.h | 1 +
>>>> 5 files changed, 148 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>>>> index 9f3013e231..6b1e4084f6 100644
>>>> --- a/src/qemu/qemu_driver.c
>>>> +++ b/src/qemu/qemu_driver.c
>>>> @@ -4041,6 +4041,21 @@ processNbdkitExitedEvent(virDomainObj *vm,
>>>> }
>>>> +static void
>>>> +processShutdownCompletedEvent(virQEMUDriver *driver,
>>>> + virDomainObj *vm)
>>>> +{
>>>> + if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
>>>> + return;
>>>
>>> Shouldn't this be:
>>>
>>> if (qemuProcessBeginStopJob(vm, VIR_JOB_DESTROY, true) < 0)
>>> return;
>>>
>>> Otherwise looking good. No need to resend, I can fix that before
>>> pushing.
>>
>> And followed by qemuProcessEndStopJob after calling qemuProcessStop.
>>
>> Jirka
>
> Just to make sure I retested successfully with the changes above.
>
Perfect!
I'll do the change before merging (among with some code style
adjustments like curly braces around multiline if-s, etc. Nothing too
intrusive).
Reviewed-by: Michal Privoznik <[email protected]>
Michal