From 2957d1d9d2494b2a8582f778e342fb7430fc1406 Mon Sep 17 00:00:00 2001 From: Brijesh Singh Date: Thu, 15 Feb 2018 09:03:24 -0600 Subject: [PATCH] sev/i386: add migration blocker SEV guest migration is not implemented yet. Signed-off-by: Brijesh Singh Reviewed-by: Dr. David Alan Gilbert [BR: FATE#322124] Signed-off-by: Bruce Rogers --- target/i386/sev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index 559881084d..a4f5a87e9b 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -20,6 +20,7 @@ #include "sysemu/sysemu.h" #include "trace.h" #include "qapi-event.h" +#include "migration/blocker.h" #include #include @@ -35,6 +36,7 @@ static uint32_t x86_cbitpos; static uint32_t x86_reduced_phys_bits; static SEVState *sev_state; static MemoryRegionRAMReadWriteOps sev_ops; +static Error *sev_mig_blocker; static SevState current_sev_guest_state = SEV_STATE_UNINIT; @@ -622,6 +624,7 @@ static void sev_launch_finish(SEVState *s) { int ret, error; + Error *local_err = NULL; trace_kvm_sev_launch_finish(); ret = sev_ioctl(KVM_SEV_LAUNCH_FINISH, 0, &error); @@ -632,6 +635,16 @@ sev_launch_finish(SEVState *s) } sev_set_guest_state(SEV_STATE_RUNNING); + + /* add migration blocker */ + error_setg(&sev_mig_blocker, + "SEV: Migration is not implemented"); + ret = migrate_add_blocker(sev_mig_blocker, &local_err); + if (local_err) { + error_report_err(local_err); + error_free(sev_mig_blocker); + exit(1); + } } static void