) structs;
List.iter (
- fun (shortname, style, _, _, _, _, _) ->
+ fun (shortname, (ret, args, optargs), _, _, _, _, _) ->
let name = "guestfs_" ^ shortname in
- (match snd style with
+ (* Ordinary arguments and optional arguments are concatenated
+ * together in the XDR args struct. The optargs_bitmask field
+ * in the header controls which optional arguments are
+ * meaningful.
+ *)
+ (match args @ optargs with
| [] -> ()
| args ->
pr "struct %s_args {\n" name;
| BufferIn n ->
pr " opaque %s<>;\n" n
| FileIn _ | FileOut _ -> ()
+ | Pointer _ -> assert false
) args;
pr "};\n\n"
);
- (match fst style with
+ (match ret with
| RErr -> ()
| RInt n ->
pr "struct %s_ret {\n" name;
*/
const GUESTFS_PROGRAM = 0x2000F5F5;
-const GUESTFS_PROTOCOL_VERSION = 2;
+const GUESTFS_PROTOCOL_VERSION = 4;
/* These constants must be larger than any possible message length. */
const GUESTFS_LAUNCH_FLAG = 0xf5f55ff5;
pr "\
struct guestfs_message_error {
- int linux_errno; /* Linux errno if available. */
+ string errno_string<32>; /* errno eg. \"EINVAL\", empty string
+ if errno not available */
string error_message<GUESTFS_ERROR_LEN>;
};
guestfs_procedure proc; /* GUESTFS_PROC_x */
guestfs_message_direction direction;
unsigned serial; /* message serial number */
+ unsigned hyper progress_hint; /* upload hint for progress bar */
+ unsigned hyper optargs_bitmask; /* bitmask for optional args */
guestfs_message_status status;
};