git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
daemon: Fix utimens so it doesn't hang on named pipes (RHBZ#761460).
[libguestfs.git]
/
generator
/
generator_xdr.ml
diff --git
a/generator/generator_xdr.ml
b/generator/generator_xdr.ml
index
b44e2ef
..
07f3ff9
100644
(file)
--- a/
generator/generator_xdr.ml
+++ b/
generator/generator_xdr.ml
@@
-1,5
+1,5
@@
(* libguestfs
(* libguestfs
- * Copyright (C) 2009-201
0
Red Hat Inc.
+ * Copyright (C) 2009-201
1
Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-65,12
+65,14
@@
let generate_xdr () =
List.iter (
fun (shortname, (ret, args, optargs), _, _, _, _, _) ->
List.iter (
fun (shortname, (ret, args, optargs), _, _, _, _, _) ->
- if optargs <> [] then
- failwithf "optional arguments not supported in XDR yet";
-
let name = "guestfs_" ^ shortname in
let name = "guestfs_" ^ shortname in
- (match args 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;
| [] -> ()
| args ->
pr "struct %s_args {\n" name;
@@
-86,6
+88,7
@@
let generate_xdr () =
| BufferIn n ->
pr " opaque %s<>;\n" n
| FileIn _ | FileOut _ -> ()
| BufferIn n ->
pr " opaque %s<>;\n" n
| FileIn _ | FileOut _ -> ()
+ | Pointer _ -> assert false
) args;
pr "};\n\n"
);
) args;
pr "};\n\n"
);
@@
-157,7
+160,7
@@
let generate_xdr () =
*/
const GUESTFS_PROGRAM = 0x2000F5F5;
*/
const GUESTFS_PROGRAM = 0x2000F5F5;
-const GUESTFS_PROTOCOL_VERSION =
3
;
+const GUESTFS_PROTOCOL_VERSION =
4
;
/* These constants must be larger than any possible message length. */
const GUESTFS_LAUNCH_FLAG = 0xf5f55ff5;
/* These constants must be larger than any possible message length. */
const GUESTFS_LAUNCH_FLAG = 0xf5f55ff5;
@@
-192,6
+195,8
@@
struct guestfs_message_header {
guestfs_procedure proc; /* GUESTFS_PROC_x */
guestfs_message_direction direction;
unsigned serial; /* message serial number */
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;
};
guestfs_message_status status;
};
@@
-209,8
+214,14
@@
struct guestfs_chunk {
* 'position' and 'total' have undefined units; however they may
* have meaning for some calls.
*
* 'position' and 'total' have undefined units; however they may
* have meaning for some calls.
*
- * NB. guestfs___recv_from_daemon assumes the XDR-encoded
+ * Notes:
+ *
+ * (1) guestfs___recv_from_daemon assumes the XDR-encoded
* structure is 24 bytes long.
* structure is 24 bytes long.
+ *
+ * (2) daemon/proto.c:async_safe_send_pulse assumes the progress
+ * message is laid out precisely in this way. So if you change
+ * this then you'd better change that function as well.
*/
struct guestfs_progress {
guestfs_procedure proc; /* @0: GUESTFS_PROC_x */
*/
struct guestfs_progress {
guestfs_procedure proc; /* @0: GUESTFS_PROC_x */