aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-02-24 16:48:19 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-03-01 15:07:12 +0100
commite5af8a259e619973538f393011b1c26a3e2f4afb (patch)
tree8522658803d023b6d64e066a41092956ff0cb4bc
parent092361e19ecc2992965729538984354099eea8cb (diff)
downloadexternal_qemu-e5af8a259e619973538f393011b1c26a3e2f4afb.zip
external_qemu-e5af8a259e619973538f393011b1c26a3e2f4afb.tar.gz
external_qemu-e5af8a259e619973538f393011b1c26a3e2f4afb.tar.bz2
Remove CONFIG_ANDROID_SNAPSHOTS macro.
The feature is no longer optional. Change-Id: I4558f12e3804e42069e8a3e6bcf0837d350206ed
-rw-r--r--android/avd/info.c8
-rw-r--r--android/avd/info.h9
-rw-r--r--android/cmdline-options.h2
-rw-r--r--android/config/config.h1
-rw-r--r--android/console.c6
-rw-r--r--android/help.c11
-rw-r--r--android/main-common.c8
-rw-r--r--android/main.c2
-rw-r--r--android/snapshot.c7
-rw-r--r--android/snapshot.h10
-rw-r--r--telephony/android_modem.c6
-rw-r--r--vl-android.c6
12 files changed, 8 insertions, 68 deletions
diff --git a/android/avd/info.c b/android/avd/info.c
index e6fdf3d..81d848d 100644
--- a/android/avd/info.c
+++ b/android/avd/info.c
@@ -726,9 +726,7 @@ _getImagePaths(AvdInfo* i, AvdInfoParams* params )
int wipeCache = (params->flags & AVDINFO_WIPE_CACHE) != 0;
int noCache = (params->flags & AVDINFO_NO_CACHE) != 0;
int noSdCard = (params->flags & AVDINFO_NO_SDCARD) != 0;
-#if CONFIG_ANDROID_SNAPSHOTS
int noSnapshots = (params->flags & AVDINFO_NO_SNAPSHOTS) != 0;
-#endif
ImageLoader l[1];
@@ -817,7 +815,6 @@ _getImagePaths(AvdInfo* i, AvdInfoParams* params )
params->forcePaths[AVD_IMAGE_SDCARD]);
}
-#if CONFIG_ANDROID_SNAPSHOTS
/* the state snapshot image. Mounting behaviour identical to
* SD card.
*/
@@ -825,7 +822,6 @@ _getImagePaths(AvdInfo* i, AvdInfoParams* params )
imageLoader_loadOptional(l, AVD_IMAGE_SNAPSHOTS,
params->forcePaths[AVD_IMAGE_SNAPSHOTS]);
}
-#endif
return 0;
}
@@ -1196,9 +1192,7 @@ _getBuildImagePaths( AvdInfo* i, AvdInfoParams* params )
int wipeData = (params->flags & AVDINFO_WIPE_DATA) != 0;
int noCache = (params->flags & AVDINFO_NO_CACHE) != 0;
int noSdCard = (params->flags & AVDINFO_NO_SDCARD) != 0;
-#if CONFIG_ANDROID_SNAPSHOTS
int noSnapshots = (params->flags & AVDINFO_NO_SNAPSHOTS) != 0;
-#endif
char temp[PATH_MAX], *p=temp, *end=p+sizeof temp;
char* srcData;
@@ -1312,14 +1306,12 @@ _getBuildImagePaths( AvdInfo* i, AvdInfoParams* params )
imageLoader_load(l, IMAGE_OPTIONAL | IMAGE_IGNORE_IF_LOCKED);
}
-#if CONFIG_ANDROID_SNAPSHOTS
/** State snapshots image
**/
if (!noSnapshots) {
imageLoader_set (l, AVD_IMAGE_SNAPSHOTS);
imageLoader_load(l, IMAGE_OPTIONAL | IMAGE_IGNORE_IF_LOCKED);
}
-#endif
return 0;
}
diff --git a/android/avd/info.h b/android/avd/info.h
index 9ccee30..2a85964 100644
--- a/android/avd/info.h
+++ b/android/avd/info.h
@@ -47,11 +47,6 @@
*/
-#if CONFIG_ANDROID_SNAPSHOTS
-#define _AVD_IMG_SNAPSHOT _AVD_IMG(SNAPSHOTS,"snapshots.img","snapshots")
-#else
-#define _AVD_IMG_SNAPSHOT
-#endif
/* a macro used to define the list of disk images managed by the
* implementation. This macro will be expanded several times with
* varying definitions of _AVD_IMG
@@ -65,7 +60,7 @@
_AVD_IMG(USERDATA,"userdata-qemu.img", "user data") \
_AVD_IMG(CACHE,"cache.img","cache") \
_AVD_IMG(SDCARD,"sdcard.img","SD Card") \
- _AVD_IMG_SNAPSHOT \
+ _AVD_IMG(SNAPSHOTS,"snapshots.img","snapshots") \
/* define the enumared values corresponding to each AVD image type
* examples are: AVD_IMAGE_KERNEL, AVD_IMAGE_SYSTEM, etc..
@@ -94,10 +89,8 @@ typedef enum {
AVDINFO_NO_SDCARD = (1 << 3),
/* use to wipe the system image with new initial values */
AVDINFO_WIPE_SYSTEM = (1 << 4),
-#if CONFIG_ANDROID_SNAPSHOTS
/* use to ignore ignore state snapshot image (default or provided) */
AVDINFO_NO_SNAPSHOTS = (1 << 5),
-#endif
} AvdFlags;
typedef struct {
diff --git a/android/cmdline-options.h b/android/cmdline-options.h
index 273d151..1494337 100644
--- a/android/cmdline-options.h
+++ b/android/cmdline-options.h
@@ -75,7 +75,6 @@ CFG_PARAM( cache, "<file>", "cache partition image (default is temporary file
CFG_FLAG ( no_cache, "disable the cache partition" )
CFG_FLAG ( nocache, "same as -no-cache" )
OPT_PARAM( sdcard, "<file>", "SD card image (default <system>/sdcard.img")
-#if CONFIG_ANDROID_SNAPSHOTS
OPT_PARAM( snapstorage, "<file>", "file that contains all state snapshots (default <datadir>/snapshots.img)")
OPT_FLAG ( no_snapstorage, "do not mount a snapshot storage file (this disables all snapshot functionality)" )
OPT_PARAM( snapshot, "<name>", "name of snapshot within storage file for auto-start and auto-save (default 'default-boot')" )
@@ -84,7 +83,6 @@ OPT_FLAG ( no_snapshot_save, "do not auto-save to snapshot on exit: abandon chan
OPT_FLAG ( no_snapshot_load, "do not auto-start from snapshot: perform a full boot" )
OPT_FLAG ( snapshot_list, "show a list of available snapshots" )
OPT_FLAG ( no_snapshot_update_time, "do not do try to correct snapshot time on restore" )
-#endif
OPT_FLAG ( wipe_data, "reset the use data image (copy it from initdata)" )
CFG_PARAM( avd, "<name>", "use a specific android virtual device" )
CFG_PARAM( skindir, "<dir>", "search skins in <dir> (default <system>/skins)" )
diff --git a/android/config/config.h b/android/config/config.h
index e07cc2c..35cc9da 100644
--- a/android/config/config.h
+++ b/android/config/config.h
@@ -15,5 +15,4 @@
#ifndef _WIN32
#define CONFIG_NAND_LIMITS 1
#endif
-#define CONFIG_ANDROID_SNAPSHOTS 1
#define CONFIG_MEMCHECK 1
diff --git a/android/console.c b/android/console.c
index d883002..de32ddb 100644
--- a/android/console.c
+++ b/android/console.c
@@ -2049,8 +2049,6 @@ static const CommandDefRec event_commands[] =
{ NULL, NULL, NULL, NULL, NULL, NULL }
};
-#if CONFIG_ANDROID_SNAPSHOTS
-
/********************************************************************************************/
/********************************************************************************************/
@@ -2150,8 +2148,6 @@ static const CommandDefRec snapshot_commands[] =
};
-#endif
-
/********************************************************************************************/
/********************************************************************************************/
@@ -2215,11 +2211,9 @@ static const CommandDefRec vm_commands[] =
"'avd name' will return the name of this virtual device\r\n",
NULL, do_avd_name, NULL },
-#if CONFIG_ANDROID_SNAPSHOTS
{ "snapshot", "state snapshot commands",
"allows you to save and restore the virtual device state in snapshots\r\n",
NULL, NULL, snapshot_commands },
-#endif
{ NULL, NULL, NULL, NULL, NULL, NULL }
};
diff --git a/android/help.c b/android/help.c
index 7df6704..e3a6643 100644
--- a/android/help.c
+++ b/android/help.c
@@ -166,9 +166,7 @@ help_disk_images( stralloc_t* out )
" system-qemu.img an *optional* persistent system image\n"
" cache.img an *optional* cache partition image\n"
" sdcard.img an *optional* SD Card partition image\n\n"
-#if CONFIG_ANDROID_SNAPSHOTS
" snapshots.img an *optional* state snapshots image\n\n"
-#endif
" If you use a virtual device, its content directory should store\n"
" all writable images, and read-only ones will be found from the\n"
@@ -184,11 +182,7 @@ help_disk_images( stralloc_t* out )
" can still run the emulator by explicitely providing the paths to\n"
" *all* required disk images through a combination of the following\n"
" options: -sysdir, -datadir, -kernel, -ramdisk, -system, -data, -cache\n"
-#if CONFIG_ANDROID_SNAPSHOTS
" -sdcard and -snapstorage.\n\n"
-#else
- " and -sdcard.\n\n"
-#endif
" The actual logic being that the emulator should be able to find all\n"
" images from the options you give it.\n\n"
@@ -205,10 +199,8 @@ help_disk_images( stralloc_t* out )
" -no-cache do not use a cache partition, even if one is\n"
" available.\n\n"
-#if CONFIG_ANDROID_SNAPSHOTS
" -no-snapstorage do not use a state snapshot image, even if one is\n"
" available.\n\n"
-#endif
,
datadir );
}
@@ -619,7 +611,6 @@ help_sdcard(stralloc_t* out)
);
}
-#if CONFIG_ANDROID_SNAPSHOTS
static void
help_snapstorage(stralloc_t* out)
{
@@ -733,8 +724,6 @@ help_snapshot_list(stralloc_t* out)
);
}
-#endif
-
static void
help_skindir(stralloc_t* out)
{
diff --git a/android/main-common.c b/android/main-common.c
index 5987f55..05108a1 100644
--- a/android/main-common.c
+++ b/android/main-common.c
@@ -726,11 +726,9 @@ AvdInfo* createAVD(AndroidOptions* opts, int* inAndroidBuild)
if (opts->wipe_data) {
android_avdParams->flags |= AVDINFO_WIPE_DATA | AVDINFO_WIPE_CACHE;
}
-#if CONFIG_ANDROID_SNAPSHOTS
if (opts->no_snapstorage) {
android_avdParams->flags |= AVDINFO_NO_SNAPSHOTS;
}
-#endif
/* legacy support: we used to use -system <dir> and -image <file>
* instead of -sysdir <dir> and -system <file>, so handle this by checking
@@ -866,7 +864,6 @@ AvdInfo* createAVD(AndroidOptions* opts, int* inAndroidBuild)
}
}
-#if CONFIG_ANDROID_SNAPSHOTS
if (!opts->snapstorage && opts->datadir) {
bufprint(tmp, tmpend, "%s/snapshots.img", opts->datadir);
if (path_exists(tmp)) {
@@ -874,7 +871,6 @@ AvdInfo* createAVD(AndroidOptions* opts, int* inAndroidBuild)
D("autoconfig: -snapstorage %s", opts->snapstorage);
}
}
-#endif // CONFIG_ANDROID_SNAPSHOTS
}
/* if certain options are set, we can force the path of
@@ -886,9 +882,7 @@ AvdInfo* createAVD(AndroidOptions* opts, int* inAndroidBuild)
_forceAvdImagePath(AVD_IMAGE_USERDATA, opts->data, "user data", 0);
_forceAvdImagePath(AVD_IMAGE_CACHE, opts->cache, "cache", 0);
_forceAvdImagePath(AVD_IMAGE_SDCARD, opts->sdcard, "SD Card", 0);
-#if CONFIG_ANDROID_SNAPSHOTS
_forceAvdImagePath(AVD_IMAGE_SNAPSHOTS, opts->snapstorage, "snapshots", 0);
-#endif
/* we don't accept -skindir without -skin now
* to simplify the autoconfig stuff with virtual devices
@@ -1022,9 +1016,7 @@ updateHwConfigFromAVD(AndroidHwConfig* hwConfig,
_update_hwconfig_path(&hwConfig->disk_dataPartition_path, avd, AVD_IMAGE_INITDATA);
_update_hwconfig_path(&hwConfig->disk_sdCard_path, avd, AVD_IMAGE_SDCARD);
_update_hwconfig_path(&hwConfig->disk_cachePartition_path, avd, AVD_IMAGE_CACHE);
-#if CONFIG_ANDROID_SNAPSHOTS
_update_hwconfig_path(&hwConfig->disk_snapshots_path, avd, AVD_IMAGE_SNAPSHOTS);
-#endif // CONFIG_ANDROID_SNAPSHOTS
if (opts->partition_size) {
char* end;
diff --git a/android/main.c b/android/main.c
index d906f8d..b99097f 100644
--- a/android/main.c
+++ b/android/main.c
@@ -490,7 +490,6 @@ int main(int argc, char **argv)
}
}
-#if CONFIG_ANDROID_SNAPSHOTS
if (!opts->no_snapstorage) {
// TODO: This should go to core
opts->snapstorage = (char*) avdInfo_getImageFile(avd, AVD_IMAGE_SNAPSHOTS);
@@ -532,7 +531,6 @@ int main(int argc, char **argv)
if (opts->snapshot_list) {
snapshot_print_and_exit(opts->snapstorage);
}
-#endif // CONFIG_ANDROID_SNAPSHOTS
if (!opts->logcat || opts->logcat[0] == 0) {
opts->logcat = getenv("ANDROID_LOG_TAGS");
diff --git a/android/snapshot.c b/android/snapshot.c
index ca86700..047465f 100644
--- a/android/snapshot.c
+++ b/android/snapshot.c
@@ -33,12 +33,10 @@
#include <time.h>
#include <unistd.h>
+#include "bswap.h"
#include "android/utils/debug.h"
#include "android/utils/system.h"
-#include "bswap.h"
-#include "snapshot.h"
-
-#if CONFIG_ANDROID_SNAPSHOTS
+#include "android/snapshot.h"
/* "Magic" sequence of four bytes required by spec to be the first four bytes
* of any Qcow file.
@@ -333,4 +331,3 @@ snapshot_print_and_exit( const char *snapstorage )
close(fd);
exit(0);
}
-#endif // CONFIG_ANDROID_SNAPSHOTS
diff --git a/android/snapshot.h b/android/snapshot.h
index c0d5965..b3d954f 100644
--- a/android/snapshot.h
+++ b/android/snapshot.h
@@ -14,13 +14,11 @@
* limitations under the License.
*/
-#ifndef SNAPSHOTS_H_
-#define SNAPSHOTS_H_
+#ifndef ANDROID_SNAPSHOT_H
+#define ANDROID_SNAPSHOT_H
#include "config/config.h"
-#if CONFIG_ANDROID_SNAPSHOTS
-
/* Prints a table with information on the snapshot stored in the file
* 'snapstorage', then exit()s.
*/
@@ -30,6 +28,4 @@ void snapshot_print_and_exit( const char *snapstorage );
extern int android_snapshot_update_time;
extern int android_snapshot_update_time_request;
-#endif
-
-#endif /* SNAPSHOTS_H_ */
+#endif /* ANDROID_SNAPSHOT_H */
diff --git a/telephony/android_modem.c b/telephony/android_modem.c
index 26276bb..437035d 100644
--- a/telephony/android_modem.c
+++ b/telephony/android_modem.c
@@ -2199,16 +2199,14 @@ handleAnswer( const char* cmd, AModem modem )
return NULL;
}
-#if CONFIG_ANDROID_SNAPSHOTS
int android_snapshot_update_time = 1;
int android_snapshot_update_time_request = 0;
-#endif
static const char*
handleSignalStrength( const char* cmd, AModem modem )
{
amodem_begin_line( modem );
-#if CONFIG_ANDROID_SNAPSHOTS
+
/* Sneak time updates into the SignalStrength request, because it's periodic.
* Ideally, we'd be able to prod the guest into asking immediately on restore
* from snapshot, but that'd require a driver.
@@ -2217,7 +2215,7 @@ handleSignalStrength( const char* cmd, AModem modem )
amodem_addTimeUpdate( modem );
android_snapshot_update_time_request = 0;
}
-#endif
+
// rssi = 0 (<-113dBm) 1 (<-111) 2-30 (<-109--53) 31 (>=-51) 99 (?!)
// ber (bit error rate) - always 99 (unknown), apparently.
// TODO: return 99 if modem->radio_state==A_RADIO_STATE_OFF, once radio_state is in snapshot.
diff --git a/vl-android.c b/vl-android.c
index 85971b9..25a6cf1 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -399,9 +399,7 @@ extern int android_display_bpp;
extern void dprint( const char* format, ... );
-#if CONFIG_ANDROID_SNAPSHOTS
const char* savevm_on_exit = NULL;
-#endif
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
@@ -3126,11 +3124,9 @@ static void main_loop(void)
vm_stop(0);
no_shutdown = 0;
} else {
-#if CONFIG_ANDROID_SNAPSHOTS
if (savevm_on_exit != NULL) {
do_savevm(cur_mon, savevm_on_exit);
}
-#endif
break;
}
}
@@ -4353,11 +4349,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_loadvm:
loadvm = optarg;
break;
-#if CONFIG_ANDROID_SNAPSHOTS
case QEMU_OPTION_savevm_on_exit:
savevm_on_exit = optarg;
break;
-#endif
case QEMU_OPTION_full_screen:
full_screen = 1;
break;