diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2020-11-05 08:58:28 -0500 |
---|---|---|
committer | Thanos Makatos <thanos.makatos@nutanix.com> | 2020-11-05 08:59:39 -0500 |
commit | 41914861c6bde1fd6e369cbbe28a5b3df5dd6b67 (patch) | |
tree | fa18a55ba55add75d58c61268c33c02586a5950b | |
parent | 5e9f8dfcc9df7dd72fe0e428000124e2f5de0f7e (diff) | |
download | libvfio-user-41914861c6bde1fd6e369cbbe28a5b3df5dd6b67.zip libvfio-user-41914861c6bde1fd6e369cbbe28a5b3df5dd6b67.tar.gz libvfio-user-41914861c6bde1fd6e369cbbe28a5b3df5dd6b67.tar.bz2 |
don't assert when accessing region fails
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
-rw-r--r-- | lib/libmuser.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c index 5badfb6..2d0805f 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -2049,7 +2049,13 @@ handle_region_access(lm_ctx_t *lm_ctx, struct vfio_user_header *hdr, ret = muser_access(lm_ctx, &muser_cmd, hdr->cmd == VFIO_USER_REGION_WRITE, data); if (ret != (int)region_access.count) { - assert(false); /* FIXME */ + lm_log(lm_ctx, LM_ERR, "bad region access acount, expected=%d, actual=%d", + region_access.count, ret); + /* FIXME we should return whatever has been accessed, not an error */ + if (ret >= 0) { + ret = -EINVAL; + } + return ret; } assert(muser_cmd.err == 0); |