aboutsummaryrefslogtreecommitdiffstats
path: root/hw/goldfish_pipe.h
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-10-11 03:02:41 +0200
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-11-08 11:41:10 -0800
commit3e92c2d49cb0e8752ce8c9a3c879c84ac3299061 (patch)
tree2b098d2ce7857f14550b688c0678a53732430cbd /hw/goldfish_pipe.h
parentc53b475e5bf2301da452cd2c81fed7c1fea2ec2a (diff)
downloadexternal_qemu-3e92c2d49cb0e8752ce8c9a3c879c84ac3299061.zip
external_qemu-3e92c2d49cb0e8752ce8c9a3c879c84ac3299061.tar.gz
external_qemu-3e92c2d49cb0e8752ce8c9a3c879c84ac3299061.tar.bz2
Fix snapshot crash
- Add snapshot load/save support to QEMU Pipes This adds the ability to save and load QEMU Pipe connections with snapshots. Note that by default, all loaded pipe client connections are force-fully closed on load. We don't have a good way to save the state of network connections to persistent storage. Properly implements snapshot save / load for qemu pipe clients. Change-Id: Ie5767f8ce40c8341b958cc5844e724dd4fc1ed2b
Diffstat (limited to 'hw/goldfish_pipe.h')
-rw-r--r--hw/goldfish_pipe.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/hw/goldfish_pipe.h b/hw/goldfish_pipe.h
index 8074619..f08cef8 100644
--- a/hw/goldfish_pipe.h
+++ b/hw/goldfish_pipe.h
@@ -94,6 +94,27 @@ typedef struct {
* then the pipe implementation shall call goldfish_pipe_wake().
*/
void (*wakeOn)( void* opaque, int flags );
+
+ /* Called to save the pipe's state to a QEMUFile, i.e. when saving
+ * snapshots. This can be NULL to indicate that no state can be saved.
+ * In this case, when the pipe is loaded, the emulator will automatically
+ * force-close so the next operation the guest performs on it will return
+ * a PIPE_ERROR_IO error code.
+ */
+ void (*save)( void* pipe, QEMUFile* file );
+
+ /* Called to load the sate of a pipe from a QEMUFile. This will always
+ * correspond to the state of the pipe as saved by a previous call to
+ * the 'save' method. Can be NULL to indicate that the pipe state cannot
+ * be loaded. In this case, the emulator will automatically force-close
+ * it.
+ *
+ * In case of success, this returns 0, and the new pipe object is returned
+ * in '*ppipe'. In case of errno code is returned to indicate a failure.
+ * 'hwpipe' and 'pipeOpaque' are the same arguments than those passed
+ * to 'init'.
+ */
+ void* (*load)( void* hwpipe, void* pipeOpaque, const char* args, QEMUFile* file);
} GoldfishPipeFuncs;
/* Register a new pipe handler type. 'pipeOpaque' is passed directly