[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 04/16] s390x: protvirt: Add migration blocker
From: |
Janosch Frank |
Subject: |
[PATCH v4 04/16] s390x: protvirt: Add migration blocker |
Date: |
Thu, 20 Feb 2020 07:56:26 -0500 |
Migration is not yet supported.
Signed-off-by: Janosch Frank <address@hidden>
---
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
- [PATCH v4 00/16] s390x: Protected Virtualization support, Janosch Frank, 2020/02/20
- [PATCH v4 01/16] Sync pv, Janosch Frank, 2020/02/20
- [PATCH v4 04/16] s390x: protvirt: Add migration blocker,
Janosch Frank <=
- [PATCH v4 02/16] s390x: protvirt: Add diag308 subcodes 8 - 10, Janosch Frank, 2020/02/20
- [PATCH v4 05/16] s390x: protvirt: Handle diag 308 subcodes 0,1,3,4, Janosch Frank, 2020/02/20
- [PATCH v4 03/16] s390x: protvirt: Support unpack facility, Janosch Frank, 2020/02/20
- [PATCH v4 06/16] s390x: protvirt: KVM intercept changes, Janosch Frank, 2020/02/20