qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Subject: [PULL 6/6] hw/intc/s390_flic: Fix crash that occurs when saving the machine state
Date: Fri, 17 May 2024 14:25:52 +0200	[thread overview]
Message-ID: <20240517122552.584215-7-thuth@redhat.com> (raw)
In-Reply-To: <20240517122552.584215-1-thuth@redhat.com>

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index 7f93080087..6771645699 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -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;
 }
-- 
2.45.0



  parent reply	other threads:[~2024-05-17 12:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 12:25 [PULL 0/6] Fix s390x crash and clean up container images Thomas Huth
2024-05-17 12:25 ` [PULL 1/6] tests/lcitool/refresh: Treat the output of lcitool as text, not as bytes Thomas Huth
2024-05-17 12:25 ` [PULL 2/6] tests/lcitool: Remove 'xfsprogs' from QEMU Thomas Huth
2024-05-17 12:25 ` [PULL 3/6] tests/lcitool: Remove g++ from the containers (except for the MinGW one) Thomas Huth
2024-05-17 12:25 ` [PULL 4/6] tests/lcitool/projects/qemu.yml: Sort entries alphabetically again Thomas Huth
2024-05-17 12:25 ` [PULL 5/6] tests/docker/dockerfiles: Update container files with "lcitool-refresh" Thomas Huth
2024-05-17 12:25 ` Thomas Huth [this message]
2024-05-18 13:25 ` [PULL 0/6] Fix s390x crash and clean up container images Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240517122552.584215-7-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).