Skip to contentSkip to conversation

Guest application exit point.

Qemu-devel Rafael K. V. Maeda 2 participants 2 messages Oct 26, 2018

lore
Share & tools
lore
#0 lore raw

Hi,

I am implementing a plugin that allocates several resources. I need to cleanup some of these resources when QEMU finishes executing the guest application. Where is the best exit point to place my cleanup functions?

I have tried registering a function call "atexit" but it does not seem to work. Any suggestions? At the moment, I am looking for a solution for x86_64 (user emulation mode).

Kind regards,
Rafael

#1 lore raw
Quoted 10 lines · Rafael K. V. Maeda

Hi,

I am implementing a plugin that allocates several resources. I need to cleanup some of these resources when QEMU finishes executing the guest application. Where is the best exit point to place my cleanup functions?

I have tried registering a function call "atexit" but it does not seem to work. Any suggestions? At the moment, I am looking for a solution for x86_64 (user emulation mode).

For linux-user have a look at preexit_cleanup() in linux-user/exit.c

Quoted 3 lines

Kind regards,
Rafael

--
Alex Bennée