diff options
author | David 'Digit' Turner <digit@google.com> | 2016-09-15 09:03:12 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2016-10-18 15:44:22 +0200 |
commit | f7f514276deed5369e35457fd487950ccc09d687 (patch) | |
tree | 320112c55ec8ccd8a9086d34d1effc3cb473743d | |
parent | 18fc22e0782d8de8fc92f6622d82bd27928d122e (diff) | |
download | qemu-android-f7f514276deed5369e35457fd487950ccc09d687.tar.gz |
android: glue: Add qemu_android_emulation_{setup,teardown}
Change-Id: I06558c46b15e8252d2d6f7dd6cdb7b99432a6478
-rw-r--r-- | android-qemu2-glue/qemu-setup.cpp | 7 | ||||
-rw-r--r-- | android-qemu2-glue/qemu-setup.h | 8 | ||||
-rw-r--r-- | vl.c | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/android-qemu2-glue/qemu-setup.cpp b/android-qemu2-glue/qemu-setup.cpp index 204467491e..f14c2e0b6d 100644 --- a/android-qemu2-glue/qemu-setup.cpp +++ b/android-qemu2-glue/qemu-setup.cpp @@ -25,3 +25,10 @@ extern "C" { bool qemu_android_emulation_early_setup() { return true; } + +bool qemu_android_emulation_setup() { + return true; +} + +void qemu_android_emulation_teardown() { +} diff --git a/android-qemu2-glue/qemu-setup.h b/android-qemu2-glue/qemu-setup.h index 19673dc966..7bd3f45cb1 100644 --- a/android-qemu2-glue/qemu-setup.h +++ b/android-qemu2-glue/qemu-setup.h @@ -26,4 +26,12 @@ ANDROID_BEGIN_HEADER * main thread. Return true on success, false otherwise. */ extern bool qemu_android_emulation_early_setup(void); +/* Call this function after the QEMU main() function has inited the + * machine, but before it has started it. */ +extern bool qemu_android_emulation_setup(void); + +/* Call this function at the end of the QEMU main() function, just + * after the main loop has returned due to a machine exit. */ +extern void qemu_android_emulation_teardown(void); + ANDROID_END_HEADER @@ -4522,6 +4522,12 @@ int main(int argc, char **argv, char **envp) return 1; } +#ifdef CONFIG_ANDROID + if (!qemu_android_emulation_setup()) { + return 1; + } +#endif + if (!realtime_init()) { return 1; } @@ -4671,6 +4677,10 @@ int main(int argc, char **argv, char **envp) tpm_cleanup(); #endif +#ifdef CONFIG_ANDROID + qemu_android_emulation_teardown(); +#endif + /* vhost-user must be cleaned up before chardevs. */ net_cleanup(); audio_cleanup(); |