From 9fb360ec4c47d750711c8f1776c180e3802b0aab Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 4 May 2011 22:01:28 +0200 Subject: Correct fix for snapshot saving speed QEMU is a weird animal. The "snapshot" property speeds-up snapshot saving but also redirect all stores to a temporary file which is deleted when the emulator exit. Use a different property to get the desired speed-up. Note that using "writeback" instead of "unsafe" forces the use of fdatasync() which will still be horribly slow. + Argument checking in avd snapshot commands in the console. (trying to load a name-less snapshot actually crashes the emulator). Change-Id: Ie61f110f037bbb3539c7f9892cb03bee8bfec6bd --- android/console.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'android/console.c') diff --git a/android/console.c b/android/console.c index de32ddb..0affb46 100644 --- a/android/console.c +++ b/android/console.c @@ -2094,6 +2094,12 @@ static int do_snapshot_save( ControlClient client, char* args ) { int ret; + + if (args == NULL) { + control_write(client, "KO: argument missing, try 'avd snapshot save '\r\n"); + return -1; + } + OutputChannel *err = output_channel_alloc(client, control_write_err_cb); do_savevm_oc(err, args); ret = output_channel_written(err); @@ -2106,6 +2112,12 @@ static int do_snapshot_load( ControlClient client, char* args ) { int ret; + + if (args == NULL) { + control_write(client, "KO: argument missing, try 'avd snapshot load '\r\n"); + return -1; + } + OutputChannel *err = output_channel_alloc(client, control_write_err_cb); do_loadvm_oc(err, args); ret = output_channel_written(err); @@ -2118,6 +2130,12 @@ static int do_snapshot_del( ControlClient client, char* args ) { int ret; + + if (args == NULL) { + control_write(client, "KO: argument missing, try 'avd snapshot del '\r\n"); + return -1; + } + OutputChannel *err = output_channel_alloc(client, control_write_err_cb); do_delvm_oc(err, args); ret = output_channel_written(err); -- cgit v1.1