aboutsummaryrefslogtreecommitdiffstats
path: root/android/main.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-02-25 15:07:11 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-03-01 15:31:11 +0100
commit25eb6557b94da066d6e137c07aeced39badf5aa6 (patch)
treeace745b614c03b9462749b1477ff0260041db618 /android/main.c
parent7e21ff9a2313a9e95fd5fa50bca24dbf3d3170a3 (diff)
downloadexternal_qemu-25eb6557b94da066d6e137c07aeced39badf5aa6.zip
external_qemu-25eb6557b94da066d6e137c07aeced39badf5aa6.tar.gz
external_qemu-25eb6557b94da066d6e137c07aeced39badf5aa6.tar.bz2
Rework AvdInfo processing.
This patch changes the code in android/avd/info.c to prepare for future patches that will move initialization disk images to the core (including locking and creating temporary files). + Remove AvdInfo structure dependencies on many of the functions, to make them more generic/usable. + Remove skin-related processing from avdInfo_new() and avdInfo_newFromBuild(). + Remove avdInfo_getSkinName() and avdInfo_getSkinDir(), and replace them with a single avdInfo_getSkinInfo(). + Rename 'qemu-hardware.ini' to 'hardware-qemu.ini' to follow the same naming convention than the one used for disk images (e.g. "userdata-qemu.img" and "system-qemu.img") Change-Id: I32cb0a5850f8c0b9df93d2630552941fd2b461c1
Diffstat (limited to 'android/main.c')
-rw-r--r--android/main.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/android/main.c b/android/main.c
index b99097f..ddf8463 100644
--- a/android/main.c
+++ b/android/main.c
@@ -214,6 +214,8 @@ int main(int argc, char **argv)
exit(0);
}
+ sanitizeOptions(opts);
+
/* Initialization of UI started with -attach-core should work differently
* than initialization of UI that starts the core. In particular....
*/
@@ -224,29 +226,30 @@ int main(int argc, char **argv)
exit(1);
}
- if (opts->nojni)
- opts->no_jni = opts->nojni;
-
- if (opts->nocache)
- opts->no_cache = opts->nocache;
-
- if (opts->noaudio)
- opts->no_audio = opts->noaudio;
-
- if (opts->noskin)
- opts->no_skin = opts->noskin;
-
/* Parses options and builds an appropriate AVD. */
avd = android_avdInfo = createAVD(opts, &inAndroidBuild);
/* get the skin from the virtual device configuration */
- opts->skin = (char*) avdInfo_getSkinName( avd );
- opts->skindir = (char*) avdInfo_getSkinDir( avd );
+ if (opts->skindir != NULL) {
+ if (opts->skin == NULL) {
+ /* NOTE: Normally handled by sanitizeOptions(), just be safe */
+ derror("The -skindir <path> option requires a -skin <name> option");
+ exit(2);
+ }
+ } else {
+ char* skinName;
+ char* skinDir;
- if (opts->skin) {
- D("autoconfig: -skin %s", opts->skin);
- }
- if (opts->skindir) {
+ avdInfo_getSkinInfo(avd, &skinName, &skinDir);
+
+ if (opts->skin == NULL) {
+ opts->skin = skinName;
+ D("autoconfig: -skin %s", opts->skin);
+ } else {
+ AFREE(skinName);
+ }
+
+ opts->skindir = skinDir;
D("autoconfig: -skindir %s", opts->skindir);
}
@@ -328,9 +331,6 @@ int main(int argc, char **argv)
opts->trace = tracePath;
}
- if (opts->no_cache)
- opts->cache = 0;
-
n = 1;
/* generate arguments for the underlying qemu main() */
{
@@ -393,11 +393,6 @@ int main(int argc, char **argv)
args[n++] = "-netfast";
}
- /* the purpose of -no-audio is to disable sound output from the emulator,
- * not to disable Audio emulation. So simply force the 'none' backends */
- if (opts->no_audio)
- opts->audio = "none";
-
if (opts->audio) {
args[n++] = "-audio";
args[n++] = opts->audio;