diff options
author | Kevin Wolf <kwolf@redhat.com> | 2021-06-09 08:46:52 -0700 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2021-06-30 13:15:44 +0200 |
commit | a6945f2287aa7f048b263d7187364cbf1dd5d94d (patch) | |
tree | 999b68cfc5e64af247afbc10b6fb99983583e76a /backends/cryptodev-vhost.c | |
parent | bf783261f0aee6e81af3916bff7606d71ccdc153 (diff) |
vhost: Add Error parameter to vhost_dev_init()
This allows callers to return better error messages instead of making
one up while the real error ends up on stderr. Most callers can
immediately make use of this because they already have an Error
parameter themselves. The others just keep printing the error with
error_report_err().
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210609154658.350308-2-kwolf@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'backends/cryptodev-vhost.c')
-rw-r--r-- | backends/cryptodev-vhost.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backends/cryptodev-vhost.c b/backends/cryptodev-vhost.c index 8231e7f1bc..bc13e466b4 100644 --- a/backends/cryptodev-vhost.c +++ b/backends/cryptodev-vhost.c @@ -52,6 +52,7 @@ cryptodev_vhost_init( { int r; CryptoDevBackendVhost *crypto; + Error *local_err = NULL; crypto = g_new(CryptoDevBackendVhost, 1); crypto->dev.max_queues = 1; @@ -66,8 +67,10 @@ cryptodev_vhost_init( /* vhost-user needs vq_index to initiate a specific queue pair */ crypto->dev.vq_index = crypto->cc->queue_index * crypto->dev.nvqs; - r = vhost_dev_init(&crypto->dev, options->opaque, options->backend_type, 0); + r = vhost_dev_init(&crypto->dev, options->opaque, options->backend_type, 0, + &local_err); if (r < 0) { + error_report_err(local_err); goto fail; } |