aboutsummaryrefslogtreecommitdiffstats
path: root/android/qemu-setup.c
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2010-06-15 16:46:32 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2010-06-15 18:07:11 -0700
commitd81e6d1ce722d7e561d495bbd4b137e728e25b83 (patch)
tree4278fc975f104bd5af5673a5075e21aa2de60755 /android/qemu-setup.c
parente3c83b5e03f7c7af930b2e954a8a44a21f115fc9 (diff)
downloadexternal_qemu-d81e6d1ce722d7e561d495bbd4b137e728e25b83.zip
external_qemu-d81e6d1ce722d7e561d495bbd4b137e728e25b83.tar.gz
external_qemu-d81e6d1ce722d7e561d495bbd4b137e728e25b83.tar.bz2
Pass core-specific options to emulator core as cmd-line options.
Change-Id: I7ed897ca92c1344505f982897e2f59cc68c42d89
Diffstat (limited to 'android/qemu-setup.c')
-rw-r--r--android/qemu-setup.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/android/qemu-setup.c b/android/qemu-setup.c
index 1ab1737..4a57b42 100644
--- a/android/qemu-setup.c
+++ b/android/qemu-setup.c
@@ -16,7 +16,6 @@
#include "modem_driver.h"
#include "proxy_http.h"
-#include "android/qemulator.h"
#include "android/android.h"
#include "android/globals.h"
#include "android/hw-sensors.h"
@@ -35,6 +34,16 @@
extern int control_console_start( int port ); /* in control.c */
+/* Contains arguments for -android-ports option. */
+char* android_op_ports = NULL;
+/* Contains arguments for -android-port option. */
+char* android_op_port = NULL;
+/* Contains arguments for -android-report-console option. */
+char* android_op_report_console = NULL;
+/* Contains arguments for -http-proxy option. */
+char* op_http_proxy = NULL;
+
+
/*** APPLICATION DIRECTORY
*** Where are we ?
***/
@@ -228,8 +237,6 @@ void android_emulation_setup( void )
}
}
- AndroidOptions* opts = qemulator_get()->opts;
-
inet_strtoip("10.0.2.15", &guest_ip);
#if 0
@@ -239,15 +246,15 @@ void android_emulation_setup( void )
}
#endif
- if (opts->port && opts->ports) {
+ if (android_op_port && android_op_ports) {
fprintf( stderr, "options -port and -ports cannot be used together.\n");
exit(1);
}
- if (opts->ports) {
+ if (android_op_ports) {
char* comma_location;
char* end;
- int console_port = strtol( opts->ports, &comma_location, 0 );
+ int console_port = strtol( android_op_ports, &comma_location, 0 );
if ( comma_location == NULL || *comma_location != ',' ) {
derror( "option -ports must be followed by two comma separated positive integer numbers" );
@@ -275,9 +282,9 @@ void android_emulation_setup( void )
base_port = console_port;
} else {
- if (opts->port) {
+ if (android_op_port) {
char* end;
- int port = strtol( opts->port, &end, 0 );
+ int port = strtol( android_op_port, &end, 0 );
if ( end == NULL || *end ||
(unsigned)((port - base_port) >> 1) >= (unsigned)tries ) {
derror( "option -port must be followed by an even integer number between %d and %d\n",
@@ -316,8 +323,8 @@ void android_emulation_setup( void )
}
}
- if (opts->report_console) {
- report_console(opts->report_console, base_port);
+ if (android_op_report_console) {
+ report_console(android_op_report_console, base_port);
}
android_modem_init( base_port );
@@ -356,13 +363,13 @@ void android_emulation_setup( void )
if (VERBOSE_CHECK(proxy))
proxy_set_verbose(1);
- if (!opts->http_proxy) {
- opts->http_proxy = getenv("http_proxy");
+ if (!op_http_proxy) {
+ op_http_proxy = getenv("http_proxy");
}
do
{
- const char* env = opts->http_proxy;
+ const char* env = op_http_proxy;
int envlen;
ProxyOption option_tab[4];
ProxyOption* option = option_tab;