From 8fc3e6effd925b9ebe39268c6ccbf9e8730ef3d4 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Mon, 9 May 2011 10:17:20 +0200 Subject: 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 --- vl-android.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'vl-android.c') 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"); } } -- cgit v1.1