aboutsummaryrefslogtreecommitdiffstats
path: root/android/avd
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-08-28 19:36:27 +0200
committerDavid 'Digit' Turner <digit@google.com>2009-08-28 19:36:27 +0200
commitcd059b15f2c7df69f4a087bd66900eb172e41d1c (patch)
treeaa9beca50259c642b40490a84329f4b1c4e4a68d /android/avd
parentb764e25f5a227ab38ae3980578aa090a561f1fca (diff)
downloadexternal_qemu-cd059b15f2c7df69f4a087bd66900eb172e41d1c.zip
external_qemu-cd059b15f2c7df69f4a087bd66900eb172e41d1c.tar.gz
external_qemu-cd059b15f2c7df69f4a087bd66900eb172e41d1c.tar.bz2
Added two new hardware properties to control AVD partition sizes.
disk.systemPartition.size (default 66MB) disk.dataPartition.size (default 66MB) If the emulator detects that an image file is larger than the corresponding setting, it will do the following: - for AVDs running from the SDK, an error message will be printed and the emulator aborts. Note that this can only happen if there are some serious mis-configuration of AVDs anyway. - when launching the emulator from the Android build system, a warning will be printed, and the partition size will be automatically adjusted at launch. Previously, trying to launch an over-sized system image would result in the emulated system booting, but then failing to find certain files, depending on how the yaffs2 disk images are built. This caused hard-to-debug issues. Note that the option -partition-size <size> can be used to override the AVD's setting at runtime.
Diffstat (limited to 'android/avd')
-rw-r--r--android/avd/hardware-properties.ini12
-rw-r--r--android/avd/hw-config-defs.h14
-rw-r--r--android/avd/info.c15
-rw-r--r--android/avd/info.h5
4 files changed, 46 insertions, 0 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index c655100..09486d2 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -124,6 +124,18 @@ default = yes
abstract = SD Card support
description = Whether the device supports insertion/removal of virtual SD Cards.
+# System partition
+name = disk.systemPartition.size
+type = diskSize
+abstract = System partition size
+default = 66MB
+
+# Data partition
+name = disk.dataPartition.size
+type = diskSize
+abstract = Data partition size
+default = 66MB
+
# Cache partition
name = disk.cachePartition
type = boolean
diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h
index 7fcf732..67bd3d3 100644
--- a/android/avd/hw-config-defs.h
+++ b/android/avd/hw-config-defs.h
@@ -122,6 +122,20 @@ HWCFG_BOOL(
"SD Card support",
"Whether the device supports insertion/removal of virtual SD Cards.")
+HWCFG_DISKSIZE(
+ disk_systemPartition_size,
+ "disk.systemPartition.size",
+ "66MB",
+ "System partition size",
+ "")
+
+HWCFG_DISKSIZE(
+ disk_dataPartition_size,
+ "disk.dataPartition.size",
+ "66MB",
+ "Data partition size",
+ "")
+
HWCFG_BOOL(
disk_cachePartition,
"disk.cachePartition",
diff --git a/android/avd/info.c b/android/avd/info.c
index 1bdb59c..10e2005 100644
--- a/android/avd/info.c
+++ b/android/avd/info.c
@@ -1358,6 +1358,21 @@ avdInfo_getImageFile( AvdInfo* i, AvdImageType imageType )
return i->imagePath[imageType];
}
+uint64_t
+avdInfo_getImageFileSize( AvdInfo* i, AvdImageType imageType )
+{
+ const char* file = avdInfo_getImageFile(i, imageType);
+ uint64_t size;
+
+ if (file == NULL)
+ return 0ULL;
+
+ if (path_get_size(file, &size) < 0)
+ return 0ULL;
+
+ return size;
+}
+
int
avdInfo_isImageReadOnly( AvdInfo* i, AvdImageType imageType )
{
diff --git a/android/avd/info.h b/android/avd/info.h
index 6cd97dc..19df807 100644
--- a/android/avd/info.h
+++ b/android/avd/info.h
@@ -131,6 +131,11 @@ const char* avdInfo_getName( AvdInfo* i );
*/
const char* avdInfo_getImageFile( AvdInfo* i, AvdImageType imageType );
+/* Return the size of a given image file. Returns 0 if the file
+ * does not exist or could not be accessed.
+ */
+uint64_t avdInfo_getImageFileSize( AvdInfo* i, AvdImageType imageType );
+
/* Returns 1 if the corresponding image file is read-only
*/
int avdInfo_isImageReadOnly( AvdInfo* i, AvdImageType imageType );