diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2022-04-19 10:35:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 10:35:24 +0100 |
commit | 9ad7474568a6c9f1fbb12fb8048f2083078a8144 (patch) | |
tree | 291ad39660c6bf075fe72eb3f8539d94200dfb27 /lib/private.h | |
parent | cdf824cf0229f0cad6679967293eb03aa48919fd (diff) | |
download | libvfio-user-9ad7474568a6c9f1fbb12fb8048f2083078a8144.zip libvfio-user-9ad7474568a6c9f1fbb12fb8048f2083078a8144.tar.gz libvfio-user-9ad7474568a6c9f1fbb12fb8048f2083078a8144.tar.bz2 |
use struct iovec for grouping buffer and length (#658)
This make it tidier and easier to pass to function the buffer and
length, instead of passing the whole msg.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'lib/private.h')
-rw-r--r-- | lib/private.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/private.h b/lib/private.h index 21c6dbd..1d19e6f 100644 --- a/lib/private.h +++ b/lib/private.h @@ -60,10 +60,10 @@ /* * Structure used to hold an in-flight request+reply. * - * Incoming request body and fds are stored in in_*. + * Incoming request body and fds are stored in in.*. * - * Outgoing requests are either stored in out_data, or out_iovecs. In the latter - * case, the iovecs refer to data that should not be freed. + * Outgoing requests are either stored in out.iov.iov_base, or out_iovecs. In + * the latter case, the iovecs refer to data that should not be freed. */ typedef struct { /* in/out */ @@ -71,17 +71,11 @@ typedef struct { bool processed_cmd; - int *in_fds; - size_t nr_in_fds; - - void *in_data; - size_t in_size; - - int *out_fds; - size_t nr_out_fds; - - void *out_data; - size_t out_size; + struct { + int *fds; + size_t nr_fds; + struct iovec iov; + } in, out; struct iovec *out_iovecs; size_t nr_out_iovecs; |