summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/guestfs.pod8
-rw-r--r--src/proto.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/guestfs.pod b/src/guestfs.pod
index 677d9449..7cb05a6c 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -1855,6 +1855,14 @@ The header contains the procedure number (C<guestfs_proc>) which is
how the receiver knows what type of args structure to expect, or none
at all.
+For functions that take optional arguments, the optional arguments are
+encoded in the C<guestfs_I<foo>_args> structure in the same way as
+ordinary arguments. A bitmask in the header indicates which optional
+arguments are meaningful. The bitmask is also checked to see if it
+contains bits set which the daemon does not know about (eg. if more
+optional arguments were added in a later version of the library), and
+this causes the call to be rejected.
+
The reply message for ordinary functions is:
total length (header + ret,
diff --git a/src/proto.c b/src/proto.c
index 5d924e86..5c22e3d6 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -658,6 +658,8 @@ guestfs___send (guestfs_h *g, int proc_nr, xdrproc_t xdrp, char *args)
hdr.direction = GUESTFS_DIRECTION_CALL;
hdr.serial = serial;
hdr.status = GUESTFS_STATUS_OK;
+ hdr.progress_hint = 0;
+ hdr.optargs_bitmask = 0;
if (!xdr_guestfs_message_header (&xdr, &hdr)) {
error (g, _("xdr_guestfs_message_header failed"));