Migration is not yet supported. Signed-off-by: Janosch Frank <fran...@linux.ibm.com> --- hw/s390x/s390-virtio-ccw.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index aa974d294e..6fba8d9331 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -42,6 +42,9 @@ #include "hw/s390x/tod.h" #include "sysemu/sysemu.h" #include "hw/s390x/pv.h" +#include "migration/blocker.h" + +static Error *pv_mig_blocker; S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) { @@ -387,6 +390,7 @@ static void s390_machine_reset(MachineState *machine) CPUState *cs, *t; S390CPU *cpu; S390CcwMachineState *ms = S390_CCW_MACHINE(machine); + static Error *local_err; /* get the reset parameters, reset them once done */ s390_ipl_get_reset_request(&cs, &reset_type); @@ -436,13 +440,20 @@ static void s390_machine_reset(MachineState *machine) } run_on_cpu(cs, s390_do_cpu_reset, RUN_ON_CPU_NULL); - if (s390_machine_protect(ms)) { + if (!pv_mig_blocker) { + error_setg(&pv_mig_blocker, + "protected VMs are currently not migrateable."); + } + migrate_add_blocker(pv_mig_blocker, &local_err); + if (!local_err && s390_machine_protect(ms)) { s390_machine_inject_pv_error(cs); - s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); - return; + migrate_del_blocker(pv_mig_blocker); + goto pv_err; } run_on_cpu(cs, s390_do_cpu_load_normal, RUN_ON_CPU_NULL); +pv_err: + s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); break; default: g_assert_not_reached(); -- 2.20.1