lib/vhost: Fix unaligned pointer value error
Reported by clang: rte_vhost_compat.c:114:36: error: taking address of packed member 'payload' of class or structure 'vhost_user_msg' may result in an unaligned pointer value. To fix it, just remove the extra unaligned pointer and inline all its accesses. Change-Id: I7e4ab536b87ab02a4ea12c55d55a6e495c3091ca Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457559 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
dc1e8d71f1
commit
5089a9c5f9
@ -111,13 +111,12 @@ spdk_extern_vhost_pre_msg_handler(int vid, void *_msg)
|
||||
}
|
||||
break;
|
||||
case VHOST_USER_GET_CONFIG: {
|
||||
struct vhost_user_config *cfg = &msg->payload.cfg;
|
||||
int rc = 0;
|
||||
|
||||
spdk_vhost_lock();
|
||||
if (vsession->vdev->backend->vhost_get_config) {
|
||||
rc = vsession->vdev->backend->vhost_get_config(vsession->vdev,
|
||||
cfg->region, cfg->size);
|
||||
msg->payload.cfg.region, msg->payload.cfg.size);
|
||||
if (rc != 0) {
|
||||
msg->size = 0;
|
||||
}
|
||||
@ -127,13 +126,13 @@ spdk_extern_vhost_pre_msg_handler(int vid, void *_msg)
|
||||
return RTE_VHOST_MSG_RESULT_REPLY;
|
||||
}
|
||||
case VHOST_USER_SET_CONFIG: {
|
||||
struct vhost_user_config *cfg = &msg->payload.cfg;
|
||||
int rc = 0;
|
||||
|
||||
spdk_vhost_lock();
|
||||
if (vsession->vdev->backend->vhost_set_config) {
|
||||
rc = vsession->vdev->backend->vhost_set_config(vsession->vdev,
|
||||
cfg->region, cfg->offset, cfg->size, cfg->flags);
|
||||
msg->payload.cfg.region, msg->payload.cfg.offset,
|
||||
msg->payload.cfg.size, msg->payload.cfg.flags);
|
||||
}
|
||||
spdk_vhost_unlock();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user