Skip to content
Snippets Groups Projects
Commit 50de5138 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

vhost: Distinguish errors in vhost_dev_get_config()


Instead of just returning 0/-1 and letting the caller make up a
meaningless error message, add an Error parameter to allow reporting the
real error and switch to 0/-errno so that different kind of errors can
be distinguished in the caller.

config_len in vhost_user_get_config() is defined by the device, so if
it's larger than VHOST_USER_MAX_CONFIG_SIZE, this is a programming
error. Turn the corresponding check into an assertion.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Message-Id: <20210609154658.350308-6-kwolf@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarRaphael Norwitz <raphael.norwitz@nutanix.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent b8da6568
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment