diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2022-11-22 14:23:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 14:23:34 +0000 |
commit | 229a1ea318a6604c46f8404d3c61802b3421421c (patch) | |
tree | cb4cd3898ea71f76f8549ada835f2c750c9a8fd7 | |
parent | ff68d2e40fca63868c1fd046ad831522583ef9f4 (diff) | |
download | libvfio-user-229a1ea318a6604c46f8404d3c61802b3421421c.zip libvfio-user-229a1ea318a6604c46f8404d3c61802b3421421c.tar.gz libvfio-user-229a1ea318a6604c46f8404d3c61802b3421421c.tar.bz2 |
add debugging to handle_device_get_region_io_fds (#723)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
-rw-r--r-- | lib/libvfio-user.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index 219b527..be4be95 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -582,12 +582,14 @@ handle_device_get_region_io_fds(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) assert(msg->out.fds == NULL); if (msg->in.iov.iov_len < sizeof(vfio_user_region_io_fds_request_t)) { + vfu_log(vfu_ctx, LOG_DEBUG, "input message too small"); return ERROR_INT(EINVAL); } req = msg->in.iov.iov_base; if (req->flags != 0 || req->count != 0) { + vfu_log(vfu_ctx, LOG_DEBUG, "bad flags or bad count"); return ERROR_INT(EINVAL); } @@ -601,6 +603,7 @@ handle_device_get_region_io_fds(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) // At least one flag must be set for a valid region. if (!(vfu_reg->flags & VFU_REGION_FLAG_MASK)) { + vfu_log(vfu_ctx, LOG_DEBUG, "bad region flags"); return ERROR_INT(EINVAL); } @@ -613,6 +616,7 @@ handle_device_get_region_io_fds(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) if (req->argsz < sizeof(vfio_user_region_io_fds_reply_t) || req->argsz > SERVER_MAX_DATA_XFER_SIZE) { + vfu_log(vfu_ctx, LOG_DEBUG, "bad argsz"); return ERROR_INT(EINVAL); } |