diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-04-19 10:35:36 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-04-19 10:35:47 -0700 |
commit | c306052006efb151cc10c28ce2f0087b8ded5e1c (patch) | |
tree | 9bf3d4e42f59c9a1a2a9d30716d387c65a50d727 /android/console.c | |
parent | aea1b87e31b952a733fe6cc6a0be4493a78ea961 (diff) | |
parent | 92568958dd42bf35667cc6451b5edd7f7d1f73a1 (diff) | |
download | external_qemu-c306052006efb151cc10c28ce2f0087b8ded5e1c.zip external_qemu-c306052006efb151cc10c28ce2f0087b8ded5e1c.tar.gz external_qemu-c306052006efb151cc10c28ce2f0087b8ded5e1c.tar.bz2 |
merge from tools_r6
Change-Id: I860d4b338cba9ea749797d6607b262c8072dd1f6
Diffstat (limited to 'android/console.c')
-rw-r--r-- | android/console.c | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/android/console.c b/android/console.c index fa86151..8eb1497 100644 --- a/android/console.c +++ b/android/console.c @@ -31,8 +31,6 @@ #include "hw/power_supply.h" #include "shaper.h" #include "modem_driver.h" -#include "block.h" -#include "block_int.h" #include "android/gps.h" #include "android/globals.h" #include "android/utils/bufprint.h" @@ -2068,135 +2066,6 @@ static const CommandDefRec geo_commands[] = /********************************************************************************************/ /********************************************************************************************/ /***** ******/ -/***** S D C A R D C O M M A N D S ******/ -/***** ******/ -/********************************************************************************************/ -/********************************************************************************************/ - -static int -do_sdcard_insert( ControlClient client, char* args ) -{ - char img[255]; - char *p; - int n; - int drv_idx; - - if (!args) { - control_write( client, "K0: argument missing, try 'sdcard insert <slot #> [imagefile]'\r\n" ); - return -1; - } - - memset(img, 0, sizeof(img)); - - n = strtoul(args, &p, 0); - if (n > 2) { - control_write( client, "K0: argument out of range\r\n" ); - return -1; - } - - if (p) { - p++; - strncpy(img, p, sizeof(img) -1); - } - - if (goldfish_mmc_is_media_inserted(n)) { - control_write( client, "K0: Slot %d already has media inserted\r\n", n ); - return -1; - } - - drv_idx = drive_get_index( IF_IDE, 0, n); - if (drv_idx >= 0) { - if (img[0] != '\0' && strcmp(img, drives_table[drv_idx].bdrv->filename)) { - if (drive_swap(drives_table[drv_idx].bdrv, img)) { - control_write (client, "K0: Drive swap failed\r\n"); - return -1; - } - } - } else { - drv_idx = drive_hotadd(img, "index=%d,media=disk", n); - if (drv_idx < 0) { - control_write (client, "K0: Drive hot-add failed\r\n"); - return -1; - } - } - - goldfish_mmc_insert(n, drives_table[drv_idx].bdrv); - - return 0; -} - -static int -do_sdcard_remove( ControlClient client, char* args ) -{ - int n; - int ins; - - if (!args) { - control_write( client, "K0: argument missing, try 'sdcard remove <slot #>'\r\n" ); - return -1; - } - - n = atoi(args); - - if ((ins = goldfish_mmc_is_media_inserted(n)) < 0) { - control_write( client, "K0: Slot %d is invalid\r\n", n ); - } else if (!ins) { - control_write( client, "K0: Slot %d has no media\r\n", n ); - return -1; - } - - goldfish_mmc_remove(n); - return 0; -} - -static int -do_sdcard_status( ControlClient client, char* args ) -{ - int i; - control_write( client, "Current SD card status:\r\n" ); - - for (i = 0; i < 2; i++) { - int drv_idx = drive_get_index( IF_IDE, 0, i); - - control_write( client, - " Slot %d, image %s, inserted %d\r\n", i, - (drv_idx >=0 ? drives_table[drv_idx].bdrv->filename : "none"), - goldfish_mmc_is_media_inserted(i)); - } - return 0; -} - -static int -do_sdcard_fail( ControlClient client, char* args ) -{ - return -ENOSYS; -} - -static const CommandDefRec sdcard_commands[] = -{ - { "insert", "hot-insert a virtual sdcard", - "'sdcard insert <slot #> [imagefile]'\r\n", - NULL, do_sdcard_insert, NULL }, - - { "remove", "hot-remove a virtual sdcard", - "'sdcard remove <slot #>'\r\n", - NULL, do_sdcard_remove, NULL }, - - { "status", "query virtual device status", - "'sdcard status'\r\n", - NULL, do_sdcard_status, NULL }, - - { "fail", "simulate an sdcard failure", - "'sdcard fail <read|write>'\r\n", - NULL, do_sdcard_fail, NULL }, - - { NULL, NULL, NULL, NULL, NULL, NULL } -}; - - -/********************************************************************************************/ -/********************************************************************************************/ -/***** ******/ /***** M A I N C O M M A N D S ******/ /***** ******/ /********************************************************************************************/ @@ -2307,10 +2176,6 @@ static const CommandDefRec main_commands[] = "allows you to modify the emulator window\r\n", NULL, NULL, window_commands }, - { "sdcard", "manage emulator sdcards", - "allows you to modify the emulator sdcard configuration\r\n", NULL, - NULL, sdcard_commands }, - { NULL, NULL, NULL, NULL, NULL, NULL } }; |