diff options
author | David 'Digit' Turner <digit@android.com> | 2011-05-05 09:39:18 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-05-05 09:39:18 -0700 |
commit | cee98de91c5380efbc321bf01a6025675fbed748 (patch) | |
tree | 18d82249eea519f169a89f1e10c58d7e8843f3d0 | |
parent | b456b97319e2ed709a875cec198f02bd0145df72 (diff) | |
parent | d80a7861fe5e21e3dcb80480a77b033e6b307dd5 (diff) | |
download | external_qemu-cee98de91c5380efbc321bf01a6025675fbed748.zip external_qemu-cee98de91c5380efbc321bf01a6025675fbed748.tar.gz external_qemu-cee98de91c5380efbc321bf01a6025675fbed748.tar.bz2 |
Merge "Fix -snapshot-list option."
-rw-r--r-- | android/main.c | 15 | ||||
-rw-r--r-- | android/snapshot.c | 2 |
2 files changed, 16 insertions, 1 deletions
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 <file> 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); } diff --git a/android/snapshot.c b/android/snapshot.c index 047465f..d02d9a8 100644 --- a/android/snapshot.c +++ b/android/snapshot.c @@ -310,7 +310,7 @@ snapshot_print_and_exit( const char *snapstorage ) { /* open snapshot file */ int fd = open(snapstorage, O_RDONLY); - if (!fd) { + if (fd < 0) { derror("Could not open snapshot file '%s': %s", snapstorage, strerror(errno)); exit(1); } |