+
+/* 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>;
+};