From d80a7861fe5e21e3dcb80480a77b033e6b307dd5 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 5 May 2011 10:24:43 +0200 Subject: Fix -snapshot-list option. This patch makes -snapshot-list work properly. More specifically: - If the AVD has snapshotting enabled, the emulator will find the appropriate file if you don't use -snapstorage. - If the AVD has no snapshot support, the emulator will print a user-friendly message to explain that. - If you're in the Android build, the emulator indicates that -snapstorage is mandatory. Bug 4384430 Change-Id: I472b12f50b7f7da5a282b24036083c7598fe48eb --- android/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'android/main.c') diff --git a/android/main.c b/android/main.c index 0682497..aa3ee46 100644 --- a/android/main.c +++ b/android/main.c @@ -261,6 +261,21 @@ int main(int argc, char **argv) } if (opts->snapshot_list) { + if (opts->snapstorage == NULL) { + /* Need to find the default snapstorage */ + avd = createAVD(opts, &inAndroidBuild); + opts->snapstorage = avdInfo_getSnapStoragePath(avd); + if (opts->snapstorage != NULL) { + D("autoconfig: -snapstorage %s", opts->snapstorage); + } else { + if (inAndroidBuild) { + derror("You must use the -snapstorage option to specify a snapshot storage file!\n"); + } else { + derror("This AVD doesn't have snapshotting enabled!\n"); + } + exit(1); + } + } snapshot_print_and_exit(opts->snapstorage); } -- cgit v1.1