aboutsummaryrefslogtreecommitdiffstats
path: root/vl-android.c
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2012-01-13 09:32:48 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-01-13 09:32:48 -0800
commite7e8b324a626a4ba112c3ad47d54eb9cfd3025ba (patch)
treea0c105d184d611f65fb7fe50fa03067b4096ce37 /vl-android.c
parent59d0f1dbd0ff7c72032bb75c18c47fef6648c5ce (diff)
parentdb450d73092add519efddcd6d55c7a0e7541ec70 (diff)
downloadexternal_qemu-e7e8b324a626a4ba112c3ad47d54eb9cfd3025ba.zip
external_qemu-e7e8b324a626a4ba112c3ad47d54eb9cfd3025ba.tar.gz
external_qemu-e7e8b324a626a4ba112c3ad47d54eb9cfd3025ba.tar.bz2
Merge "Respect HW configs when loading VM from snapshots."
Diffstat (limited to 'vl-android.c')
-rw-r--r--vl-android.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/vl-android.c b/vl-android.c
index 322ddca..8f439ac 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -208,6 +208,8 @@ int qemu_main(int argc, char **argv, char **envp);
#include "android/core-init-utils.h"
#include "android/audio-test.h"
+#include "android/snaphost-android.h"
+
#ifdef CONFIG_STANDALONE_CORE
/* Verbose value used by the standalone emulator core (without UI) */
unsigned long android_verbose;
@@ -235,8 +237,6 @@ extern void android_emulator_set_base_port(int port);
#include "libslirp.h"
#endif
-
-
#define DEFAULT_RAM_SIZE 128
/* Max number of USB devices that can be specified on the commandline. */
@@ -2025,6 +2025,10 @@ static void main_loop(void)
no_shutdown = 0;
} else {
if (savevm_on_exit != NULL) {
+ /* Prior to saving VM to the snapshot file, save HW config
+ * settings for that VM, so we can match them when VM gets
+ * loaded from the snapshot. */
+ snaphost_save_config(savevm_on_exit);
do_savevm(cur_mon, savevm_on_exit);
}
break;
@@ -3511,6 +3515,12 @@ int main(int argc, char **argv, char **envp)
androidHwConfig_init(android_hw, 0);
androidHwConfig_read(android_hw, hw_ini);
+ /* If we're loading VM from a snapshot, make sure that the current HW config
+ * matches the one with which the VM has been saved. */
+ if (loadvm && *loadvm && !snaphost_match_configs(hw_ini, loadvm)) {
+ exit(0);
+ }
+
iniFile_free(hw_ini);
{
@@ -4229,7 +4239,6 @@ int main(int argc, char **argv, char **envp)
stralloc_reset(kernel_config);
}
-
for (env = first_cpu; env != NULL; env = env->next_cpu) {
for (i = 0; i < nb_numa_nodes; i++) {
if (node_cpumask[i] & (1 << env->cpu_index)) {