aboutsummaryrefslogtreecommitdiffstats
path: root/vl-android.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-09 10:17:20 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-05-12 13:21:41 +0200
commit8fc3e6effd925b9ebe39268c6ccbf9e8730ef3d4 (patch)
tree0e0c910a6bb05edc2417c41da3ce5b29eeb9d4a3 /vl-android.c
parentb9697ca80a8403f2cc07de010511510fdaa87315 (diff)
downloadexternal_qemu-8fc3e6effd925b9ebe39268c6ccbf9e8730ef3d4.zip
external_qemu-8fc3e6effd925b9ebe39268c6ccbf9e8730ef3d4.tar.gz
external_qemu-8fc3e6effd925b9ebe39268c6ccbf9e8730ef3d4.tar.bz2
Fix SDCard speed issues too.
It looks like we also need to set the 'cache' property to 'unsafe' when initializing the SDCard block device. Otherwise it will be mounted as O_DIRECT, making all i/o operations on the SD Card extremely slow. Change-Id: Id1a72f926c73dc6981a568f005f19cfc50f724d5
Diffstat (limited to 'vl-android.c')
-rw-r--r--vl-android.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/vl-android.c b/vl-android.c
index a1b88be..2e1f0f9 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -5079,6 +5079,13 @@ int main(int argc, char **argv, char **envp)
} else {
/* Successful locking */
hda_opts = drive_add(sdPath, HD_ALIAS, 0);
+ /* Set this property of any operation involving the SD Card
+ * will be x100 slower, due to the corresponding file being
+ * mounted as O_DIRECT. Note that this is only 'unsafe' in
+ * the context of an emulator crash. The data is already
+ * synced properly when the emulator exits (either normally or through ^C).
+ */
+ qemu_opt_set(hda_opts, "cache", "unsafe");
}
}
}
@@ -5093,10 +5100,7 @@ int main(int argc, char **argv, char **envp)
PANIC("Snapshot storage already in use: %s", spath);
}
hdb_opts = drive_add(spath, HD_ALIAS, 1);
- /* VERY IMPORTANT:
- * Set this property or the file will be mounted with O_DIRECT,
- * which will slow down snapshot saving x100 !
- */
+ /* See comment above to understand why this is needed. */
qemu_opt_set(hdb_opts, "cache", "unsafe");
}
}