vhost-user-blk: Improve error reporting in realize
commit5b9243d2654adc58ce472d0536a7a177b4fe0f90
authorKevin Wolf <kwolf@redhat.com>
Thu, 29 Apr 2021 17:13:13 +0000 (29 19:13 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 18 May 2021 10:57:38 +0000 (18 12:57 +0200)
tree230cc0d73c15f60144a1af52a6f7c5ebe5271f4d
parentdabefdd6abcbc7d858e9413e4734aab2e0b5c8d9
vhost-user-blk: Improve error reporting in realize

Now that vhost_user_blk_connect() is not called from an event handler
any more, but directly from vhost_user_blk_device_realize(), we can
actually make use of Error again instead of calling error_report() in
the inner function and setting a more generic and therefore less useful
error message in realize() itself.

With Error, the callers are responsible for adding context if necessary
(such as the "-device" option the error refers to). Additional prefixes
are redundant and better omitted.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20210429171316.162022-4-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/vhost-user-blk.c