aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-qemud.h
diff options
context:
space:
mode:
authorOt ten Thije <ottenthije@google.com>2010-09-20 10:29:22 +0100
committerOt ten Thije <ottenthije@google.com>2010-10-14 16:20:03 +0100
commit871da2aa80687142bec00ef7c1112253c76c32bb (patch)
tree02e55b1f236f63516c13b47e1b68b092b400f390 /android/hw-qemud.h
parentbd62acb45d0199940f3baecfa288a2173e4428ae (diff)
downloadexternal_qemu-871da2aa80687142bec00ef7c1112253c76c32bb.zip
external_qemu-871da2aa80687142bec00ef7c1112253c76c32bb.tar.gz
external_qemu-871da2aa80687142bec00ef7c1112253c76c32bb.tar.bz2
Added state snapshot support for QemuD.
With this patch, both modem and sensor functionality are correctly restored when a state snapshot is loaded. This was not the case previously because communication with either of these services is done using the qemud daemon, which did not support snapshots. The boot-properties and charpipe services have no specific save/load functionality yet, since the framework itself should be reviewed first. Adding support for bootproperties should not be difficult though, and charpipe may not need it. For a description of the high-level process for saving and loading, consult section IV "State snapshots" in docs/ANDROID-QEMUD.TXT. Change-Id: I5b06d88b911ca096e78060163174904c48a01c66
Diffstat (limited to 'android/hw-qemud.h')
-rw-r--r--android/hw-qemud.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/android/hw-qemud.h b/android/hw-qemud.h
index 8aae74d..18eec6f 100644
--- a/android/hw-qemud.h
+++ b/android/hw-qemud.h
@@ -72,6 +72,16 @@ typedef void (*QemudClientClose)( void* opaque );
*/
typedef void (*QemudClientRecv) ( void* opaque, uint8_t* msg, int msglen, QemudClient* client );
+/* A function that will be called when the state of the client should be
+ * saved to a snapshot.
+ */
+typedef void (*QemudClientSave) ( QEMUFile* f, QemudClient* client, void* opaque );
+
+/* A function that will be called when the state of the client should be
+ * restored from a snapshot.
+ */
+typedef int (*QemudClientLoad) ( QEMUFile* f, QemudClient* client, void* opaque );
+
/* Register a new client for a given service.
* 'clie_opaque' will be sent as the first argument to 'clie_recv' and 'clie_close'
* 'clie_recv' and 'clie_close' are both optional and may be NULL.
@@ -83,7 +93,9 @@ extern QemudClient* qemud_client_new( QemudService* service,
int channel_id,
void* clie_opaque,
QemudClientRecv clie_recv,
- QemudClientClose clie_close );
+ QemudClientClose clie_close,
+ QemudClientSave clie_save,
+ QemudClientLoad clie_load );
/* Enable framing on a given client channel.
*/
@@ -104,13 +116,25 @@ extern void qemud_client_close( QemudClient* client );
*/
typedef QemudClient* (*QemudServiceConnect)( void* opaque, QemudService* service, int channel );
+/* A function that will be called when the state of the service should be
+ * saved to a snapshot.
+ */
+typedef void (*QemudServiceSave) ( QEMUFile* f, QemudService* service, void* opaque );
+
+/* A function that will be called when the state of the service should be
+ * restored from a snapshot.
+ */
+typedef int (*QemudServiceLoad) ( QEMUFile* f, QemudService* service, void* opaque );
+
/* Register a new qemud service.
* 'serv_opaque' is the first parameter to 'serv_connect'
*/
extern QemudService* qemud_service_register( const char* serviceName,
int max_clients,
void* serv_opaque,
- QemudServiceConnect serv_connect );
+ QemudServiceConnect serv_connect,
+ QemudServiceSave serv_save,
+ QemudServiceLoad serv_load);
/* Sends a message to all clients of a given service.
*/