]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/intc/s390_flic: Fix crash that occurs when saving the machine state
authorThomas Huth <thuth@redhat.com>
Fri, 17 May 2024 06:15:53 +0000 (08:15 +0200)
committerThomas Huth <thuth@redhat.com>
Fri, 17 May 2024 09:18:32 +0000 (11:18 +0200)
adapter_info_so_needed() treats its "opaque" parameter as a S390FLICState,
but the function belongs to a VMStateDescription that is attached to a
TYPE_VIRTIO_CCW_BUS device. This is currently causing a crash when the
user tries to save or migrate the VM state. Fix it by using s390_get_flic()
to get the correct device here instead.

Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Fixes: 9d1b0f5bf5 ("s390_flic: add migration-enabled property")
Message-ID: <20240517061553.564529-1-thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/intc/s390_flic.c

index 7f9308008770dab34f93616e88a804e57c1d8363..677164569909be2070ec734a01b9cf765b5b16e9 100644 (file)
@@ -459,7 +459,7 @@ type_init(qemu_s390_flic_register_types)
 
 static bool adapter_info_so_needed(void *opaque)
 {
-    S390FLICState *fs = S390_FLIC_COMMON(opaque);
+    S390FLICState *fs = s390_get_flic();
 
     return fs->migration_enabled;
 }