Signed-off-by: Marc-André Lureau <[email protected]>
---
hw/s390x/s390-virtio-ccw.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 4d35f9b10bc..d27d82a378a 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -729,6 +729,11 @@ static void s390_nmi(NMIState *n, int cpu_index, Error
**errp)
{
CPUState *cs = qemu_get_cpu(cpu_index);
+ if (!cs) {
+ error_setg(errp, "CPU %d does not exist", cpu_index);
+ return;
+ }
+
s390_cpu_restart(S390_CPU(cs));
}
--
2.54.0