aboutsummaryrefslogtreecommitdiffstats
path: root/android/snaphost-android.h
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2012-01-12 13:37:40 -0800
committerVladimir Chtchetkine <vchtchetkine@google.com>2012-01-13 08:16:05 -0800
commitdb450d73092add519efddcd6d55c7a0e7541ec70 (patch)
treea4de5f7d4c9d1fb35a376dcd198da8c06c846b4f /android/snaphost-android.h
parentaa1af37d8b3c3a21eb4cac4a225225425b50d08c (diff)
downloadexternal_qemu-db450d73092add519efddcd6d55c7a0e7541ec70.zip
external_qemu-db450d73092add519efddcd6d55c7a0e7541ec70.tar.gz
external_qemu-db450d73092add519efddcd6d55c7a0e7541ec70.tar.bz2
Respect HW configs when loading VM from snapshots.
Changing HW configuration properties may cause emulator / guest system crash on condition that VM has been loaded from a snapshot. This CL addresses this issue in the following way: 1. Each time a snapshot is saved, a backup copy of HW config is saved with it. 2. Each time a snapshot is loaded, emulator finds an appropriate HW config backup, and compares current HW config with the one that was saved in the backup, and if configs are different, emulator exits with an appropriate error. Change-Id: I730bec0afbe166e88189fdcc4804b76e109e4422
Diffstat (limited to 'android/snaphost-android.h')
-rw-r--r--android/snaphost-android.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/android/snaphost-android.h b/android/snaphost-android.h
new file mode 100644
index 0000000..ae558ba
--- /dev/null
+++ b/android/snaphost-android.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2012 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+*/
+
+#ifndef _ANDROID_SNAPHOST_ANDROID_H_
+#define _ANDROID_SNAPHOST_ANDROID_H_
+
+/* Matches HW config saved for a VM snapshot against the current HW config.
+ * Param:
+ * hw_ini - IniFile instance containing the current HW config settings.
+ * name - Name of the snapshot for which the VM is loading.
+ * Return:
+ * Boolean: 1 if HW configurations match, or 0 if they don't match.
+ */
+extern int snaphost_match_configs(IniFile* hw_ini, const char* name);
+
+/* Saves HW config settings for the current VM.
+ * Param:
+ * name - Name of the snapshot for the current VM.
+ */
+extern void snaphost_save_config(const char* name);
+
+#endif /* _ANDROID_SNAPHOST_ANDROID_H_ */
+