summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-12-01 10:30:44 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-12-01 13:34:28 +0000
commit3aa8182c3cc478bf723205f1a4dd84e160768448 (patch)
treedd4da33344a17fe4da7a997dd9d4d8aecbbb07da /src
parentfdc8805362c6fc587bb7985c5290362ad3094f4e (diff)
downloadlibguestfs-3aa8182c3cc478bf723205f1a4dd84e160768448.tar.gz
libguestfs-3aa8182c3cc478bf723205f1a4dd84e160768448.tar.xz
libguestfs-3aa8182c3cc478bf723205f1a4dd84e160768448.zip
protocol: Upload progress messages and optional arguments.
Two unrelated changes to the protocol to support progress messages during uploads, and optional arguments. Note that this makes an incompatible change to the protocol, and this is reflected in the protocol version field (3 -> 4).
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"));