aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2010-08-11 15:30:32 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2010-08-24 07:29:49 -0700
commit7fbf49776a98847a5f95325646f7eb5ff787423f (patch)
tree6bbdef92b669532c74800927632c932491f684c1 /android
parentb5365f32d7b1dcc6c3e9be7584ce8d4f68b3e7e1 (diff)
downloadexternal_qemu-7fbf49776a98847a5f95325646f7eb5ff787423f.zip
external_qemu-7fbf49776a98847a5f95325646f7eb5ff787423f.tar.gz
external_qemu-7fbf49776a98847a5f95325646f7eb5ff787423f.tar.bz2
Cleanup stuff for the UI build
1. Move DNS server registration entirely to the core. 2. Move -memcheck option initialization entirely to the core. 3. Move qemu_help routine (used by both, Core and UI) to common qemu-help.c file. Change-Id: I5e47e94bdc375f0e037ccc6bd88daeb5fa06d1cf
Diffstat (limited to 'android')
-rw-r--r--android/main.c91
1 files changed, 6 insertions, 85 deletions
diff --git a/android/main.c b/android/main.c
index 2eba00f..25710bb 100644
--- a/android/main.c
+++ b/android/main.c
@@ -17,7 +17,7 @@
#ifdef _WIN32
#include <process.h>
#endif
-#include "libslirp.h"
+
#include "sockets.h"
#include "android/android.h"
@@ -69,9 +69,6 @@
#include "android/qemulator.h"
#include "android/display.h"
-/* in vl.c */
-extern void qemu_help(int code);
-
#include "framebuffer.h"
AndroidRotation android_framebuffer_rotation;
@@ -702,29 +699,6 @@ void emulator_help( void )
exit(1);
}
-static int
-add_dns_server( const char* server_name )
-{
- SockAddress addr;
-
- if (sock_address_init_resolve( &addr, server_name, 55, 0 ) < 0) {
- fprintf(stderr,
- "### WARNING: can't resolve DNS server name '%s'\n",
- server_name );
- return -1;
- }
-
- D( "DNS server name '%s' resolved to %s", server_name, sock_address_to_string(&addr) );
-
- if ( slirp_add_dns_server( &addr ) < 0 ) {
- fprintf(stderr,
- "### WARNING: could not add DNS server '%s' to the network stack\n", server_name);
- return -1;
- }
- return 0;
-}
-
-
/* this function is used to perform auto-detection of the
* system directory in the case of a SDK installation.
*
@@ -892,7 +866,6 @@ int main(int argc, char **argv)
int radio_serial = 0;
int qemud_serial = 0;
int shell_serial = 0;
- int dns_count = 0;
unsigned cachePartitionSize = 0;
unsigned systemPartitionSize = 0;
unsigned dataPartitionSize = 0;
@@ -961,16 +934,6 @@ int main(int argc, char **argv)
exit(1);
}
- /* special case, if -qemu -h is used, directly invoke the QEMU-specific help */
- if (argc > 0) {
- int nn;
- for (nn = 0; nn < argc; nn++)
- if (!strcmp(argv[nn], "-h")) {
- qemu_help(0);
- break;
- }
- }
-
if (android_charmap_setup(opts->charmap)) {
exit(1);
}
@@ -1401,41 +1364,6 @@ int main(int argc, char **argv)
if (opts->no_cache)
opts->cache = 0;
- if (opts->dns_server) {
- char* x = strchr(opts->dns_server, ',');
- dns_count = 0;
- if (x == NULL)
- {
- if ( add_dns_server( opts->dns_server ) == 0 )
- dns_count = 1;
- }
- else
- {
- x = strdup(opts->dns_server);
- while (*x) {
- char* y = strchr(x, ',');
-
- if (y != NULL)
- *y = 0;
-
- if (y == NULL || y > x) {
- if ( add_dns_server( x ) == 0 )
- dns_count += 1;
- }
-
- if (y == NULL)
- break;
-
- x = y+1;
- }
- }
- if (dns_count == 0)
- fprintf( stderr, "### WARNING: will use system default DNS server\n" );
- }
-
- if (dns_count == 0)
- dns_count = slirp_get_system_dns_servers();
-
n = 1;
/* generate arguments for the underlying qemu main() */
{
@@ -1464,6 +1392,11 @@ int main(int argc, char **argv)
}
}
+ if (opts->dns_server) {
+ args[n++] = "-dns-server";
+ args[n++] = opts->dns_server;
+ }
+
args[n++] = "-initrd";
args[n++] = (char*) avdInfo_getImageFile(avd, AVD_IMAGE_RAMDISK);
@@ -1778,14 +1711,6 @@ int main(int argc, char **argv)
p = bufprint(p, end, " android.tracing=1");
}
-#ifdef CONFIG_MEMCHECK
- if (opts->memcheck) {
- /* This will set ro.kernel.memcheck system property
- * to memcheck's tracing flags. */
- p = bufprint(p, end, " memcheck=%s", opts->memcheck);
- }
-#endif // CONFIG_MEMCHECK
-
if (!opts->no_jni) {
p = bufprint(p, end, " android.checkjni=1");
}
@@ -1823,10 +1748,6 @@ int main(int argc, char **argv)
p = bufprint(p, end, " android.qemud=ttyS%d", qemud_serial);
}
- if (dns_count > 0) {
- p = bufprint(p, end, " android.ndns=%d", dns_count);
- }
-
if (opts->bootchart) {
p = bufprint(p, end, " androidboot.bootchart=%s", opts->bootchart);
}