X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fproto.c;h=00e3166c0e2765dd56f858d5131bbf9e8167b7c5;hb=0938509e0422363554023ab99381fd70a22a6e08;hp=63d1cc990003652924da66ad6ed3d4b8bd7b4953;hpb=d859c283c469b9d9124d90d0ac32024671372ed5;p=libguestfs.git diff --git a/daemon/proto.c b/daemon/proto.c index 63d1cc9..00e3166 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include /* defines MIN */ @@ -45,6 +46,23 @@ int proc_nr; int serial; +/* Hint for implementing progress messages for uploaded/incoming data. + * The caller sets this to a value > 0 if it knows or can estimate how + * much data will be sent (this is not always known, eg. for uploads + * coming from a pipe). If this is known then we can emit progress + * messages as we write the data. + */ +uint64_t progress_hint; + +/* Optional arguments bitmask. Caller sets this to indicate which + * optional arguments in the guestfs__args structure are + * meaningful. Optional arguments not covered by the bitmask are set + * to arbitrary values and the daemon should ignore them. If the + * bitmask has bits set that the daemon doesn't understand, then the + * whole call is rejected early in processing. + */ +uint64_t optargs_bitmask; + /* Time at which we received the current request. */ static struct timeval start_t; @@ -152,6 +170,8 @@ main_loop (int _sock) proc_nr = hdr.proc; serial = hdr.serial; + progress_hint = hdr.progress_hint; + optargs_bitmask = hdr.optargs_bitmask; /* Clear errors before we call the stub functions. This is just * to ensure that we can accurately report errors in cases where @@ -397,6 +417,7 @@ receive_file (receive_cb cb, void *opaque) return 0; /* end of file */ } + /* Note that the callback can generate progress messages. */ if (cb) r = cb (opaque, chunk.data.data_val, chunk.data.data_len); else