diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-01-12 13:37:40 -0800 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-01-13 08:16:05 -0800 |
commit | db450d73092add519efddcd6d55c7a0e7541ec70 (patch) | |
tree | a4de5f7d4c9d1fb35a376dcd198da8c06c846b4f /android/main.c | |
parent | aa1af37d8b3c3a21eb4cac4a225225425b50d08c (diff) | |
download | external_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/main.c')
-rw-r--r-- | android/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/android/main.c b/android/main.c index 1adb6a1..c56bb5c 100644 --- a/android/main.c +++ b/android/main.c @@ -1308,7 +1308,11 @@ int main(int argc, char **argv) coreHwIniPath = tempfile_path(tempIni); } - if (iniFile_saveToFile(hwIni, coreHwIniPath) < 0) { + /* While saving HW config, ignore valueless entries. This will not break + * anything, but will significantly simplify comparing the current HW + * config with the one that has been associated with a snapshot (in case + * VM starts from a snapshot for this instance of emulator). */ + if (iniFile_saveToFileClean(hwIni, coreHwIniPath) < 0) { derror("Could not write hardware.ini to %s: %s", coreHwIniPath, strerror(errno)); exit(2); } |