aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2020-06-04 14:18:52 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2021-02-08 16:57:38 +1100
commitc9f5aaa6bce819c1863c2a56b187cb9eb521fc92 (patch)
tree63ec7cac1c3fe0d9a45aa044134e00bc36878655 /accel
parente0292d7c62673546c01d5c6b245735fdfef81840 (diff)
sev: Add Error ** to sev_kvm_init()
This allows failures to be reported richly and idiomatically. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'accel')
-rw-r--r--accel/kvm/kvm-all.c4
-rw-r--r--accel/kvm/sev-stub.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 88a6b8c19e..226e1556f9 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2185,9 +2185,11 @@ static int kvm_init(MachineState *ms)
* encryption context.
*/
if (ms->cgs) {
+ Error *local_err = NULL;
/* FIXME handle mechanisms other than SEV */
- ret = sev_kvm_init(ms->cgs);
+ ret = sev_kvm_init(ms->cgs, &local_err);
if (ret < 0) {
+ error_report_err(local_err);
goto err;
}
}
diff --git a/accel/kvm/sev-stub.c b/accel/kvm/sev-stub.c
index 3d4787ae4a..512e205f7f 100644
--- a/accel/kvm/sev-stub.c
+++ b/accel/kvm/sev-stub.c
@@ -15,7 +15,7 @@
#include "qemu-common.h"
#include "sysemu/sev.h"
-int sev_kvm_init(ConfidentialGuestSupport *cgs)
+int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
{
/* SEV can't be selected if it's not compiled */
g_assert_not_reached();