summaryrefslogtreecommitdiffstats
path: root/src/guestfs_protocol.x
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-18 13:17:12 +0100
committerRichard Jones <rjones@redhat.com>2009-04-18 13:17:12 +0100
commit1765330e07a48dc6f7bdef7007f69ebe606fa731 (patch)
tree659ce188bbe1a0568fc4b58504c6de025b9b2e3d /src/guestfs_protocol.x
parent92804dec7c4982d2039f81586bc4a5cacb46217b (diff)
downloadlibguestfs-1765330e07a48dc6f7bdef7007f69ebe606fa731.tar.gz
libguestfs-1765330e07a48dc6f7bdef7007f69ebe606fa731.tar.xz
libguestfs-1765330e07a48dc6f7bdef7007f69ebe606fa731.zip
Rewrite of main loop impl, start of FileIn/FileOut support.
Diffstat (limited to 'src/guestfs_protocol.x')
-rw-r--r--src/guestfs_protocol.x40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/guestfs_protocol.x b/src/guestfs_protocol.x
index ba5d70cb..d77bb5fe 100644
--- a/src/guestfs_protocol.x
+++ b/src/guestfs_protocol.x
@@ -541,7 +541,7 @@ enum guestfs_procedure {
GUESTFS_PROC_BLOCKDEV_GETSIZE64 = 63,
GUESTFS_PROC_BLOCKDEV_FLUSHBUFS = 64,
GUESTFS_PROC_BLOCKDEV_REREADPT = 65,
- GUESTFS_PROC_dummy
+ GUESTFS_PROC_NR_PROCS
};
const GUESTFS_MESSAGE_MAX = 4194304;
@@ -565,6 +565,19 @@ struct guestfs_message_error {
string error<GUESTFS_ERROR_LEN>; /* error message */
};
+/* For normal requests and replies (not involving any FileIn or
+ * FileOut parameters), the protocol is:
+ *
+ * For requests:
+ * total length (header + args, but not including length word itself)
+ * header
+ * guestfs_foo_args struct
+ * For replies:
+ * total length (as above)
+ * header
+ * guestfs_foo_ret struct
+ */
+
struct guestfs_message_header {
unsigned prog; /* GUESTFS_PROGRAM */
unsigned vers; /* GUESTFS_PROTOCOL_VERSION */
@@ -573,3 +586,28 @@ struct guestfs_message_header {
unsigned serial; /* message serial number */
guestfs_message_status status;
};
+
+/* Chunked encoding used to transfer files, for FileIn and FileOut
+ * parameters.
+ *
+ * For requests which have >= 1 FileIn parameter:
+ * length of header + args (but not length word itself, and not chunks)
+ * header
+ * guestfs_foo_args struct
+ * sequence of chunks for FileIn param #0
+ * sequence of chunks for FileIn param #1 etc
+ *
+ * For replies which have >= 1 FileOut parameter:
+ * length of header + ret (but not length word itself, and not chunks)
+ * header
+ * guestfs_foo_ret struct
+ * sequence of chunks for FileOut param #0
+ * sequence of chunks for FileOut param #1 etc
+ */
+const GUESTFS_MAX_CHUNK_SIZE = 8192;
+
+struct guestfs_chunk {
+ int cancel; /* if non-zero, transfer is cancelled */
+ /* data size is 0 bytes if the transfer has finished successfully */
+ opaque data<GUESTFS_MAX_CHUNK_SIZE>;
+};