From: Thomas Huth <thuth@redhat.com>
To: Marc Hartmayer <mhartmay@linux.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Cc: qemu-s390x <qemu-s390x@nongnu.org>
Subject: Re: [PATCH 02/13] s390_flic: add migration-enabled property
Date: Fri, 17 May 2024 07:47:05 +0200 [thread overview]
Message-ID: <d0e2ad55-52fd-4be5-ba54-f3d437c1a10f@redhat.com> (raw)
In-Reply-To: <877cftvmx3.fsf@linux.ibm.com>
On 16/05/2024 16.42, Marc Hartmayer wrote:
> On Thu, May 09, 2024 at 07:00 PM +0200, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> Instead of mucking with css_migration_enabled(), add a property specific to
>> the FLIC device, similar to what is done for TYPE_S390_STATTRIB.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> include/hw/s390x/s390_flic.h | 1 +
>> hw/intc/s390_flic.c | 6 +++++-
>> hw/s390x/s390-virtio-ccw.c | 1 +
>> 3 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h
>> index 3907a13d076..bcb081def58 100644
>> --- a/include/hw/s390x/s390_flic.h
>> +++ b/include/hw/s390x/s390_flic.h
>> @@ -47,6 +47,7 @@ struct S390FLICState {
>> /* to limit AdapterRoutes.num_routes for compat */
>> uint32_t adapter_routes_max_batch;
>> bool ais_supported;
>> + bool migration_enabled;
>> };
>>
>>
>> diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
>> index f4a848460b8..7f930800877 100644
>> --- a/hw/intc/s390_flic.c
>> +++ b/hw/intc/s390_flic.c
>> @@ -405,6 +405,8 @@ static void qemu_s390_flic_class_init(ObjectClass *oc, void *data)
>> static Property s390_flic_common_properties[] = {
>> DEFINE_PROP_UINT32("adapter_routes_max_batch", S390FLICState,
>> adapter_routes_max_batch, ADAPTER_ROUTES_MAX_GSI),
>> + DEFINE_PROP_BOOL("migration-enabled", S390FLICState,
>> + migration_enabled, true),
>> DEFINE_PROP_END_OF_LIST(),
>> };
>>
>> @@ -457,7 +459,9 @@ type_init(qemu_s390_flic_register_types)
>>
>> static bool adapter_info_so_needed(void *opaque)
>> {
>> - return css_migration_enabled();
>> + S390FLICState *fs = S390_FLIC_COMMON(opaque);
>> +
>> + return fs->migration_enabled;
>> }
...
> This patch causes QEMU to crash when trying to save the domain state
> (e.g. using libvirt)
Oh, drat, that vmstate belongs to a ccw device, not to a flic device, so the
"opaque" pointer in adapter_info_so_needed points to the wrong structure.
I guess the easiest fix is:
diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
--- 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;
}
I'll send it as a proper patch...
Thomas
next prev parent reply other threads:[~2024-05-17 5:48 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 17:00 [PATCH 00/13] fix --without-default-devices build and (mostly) tests Paolo Bonzini
2024-05-09 17:00 ` [PATCH 01/13] s390x: move s390_cpu_addr2state to target/s390x/sigp.c Paolo Bonzini
2024-05-10 4:59 ` Thomas Huth
2024-05-09 17:00 ` [PATCH 02/13] s390_flic: add migration-enabled property Paolo Bonzini
2024-05-10 5:06 ` Thomas Huth
2024-05-16 14:42 ` Marc Hartmayer
2024-05-17 5:47 ` Thomas Huth [this message]
2024-05-09 17:00 ` [PATCH 03/13] s390: move css_migration_enabled from machine to css.c Paolo Bonzini
2024-05-10 5:37 ` Thomas Huth
2024-05-10 9:19 ` Paolo Bonzini
2024-05-09 17:00 ` [PATCH 04/13] s390x: select correct components for no-board build Paolo Bonzini
2024-05-10 5:11 ` Thomas Huth
2024-05-09 17:00 ` [PATCH 05/13] tests/qtest: s390x: fix operation in a build without any boards or devices Paolo Bonzini
2024-05-10 5:13 ` Thomas Huth
2024-05-09 17:00 ` [PATCH 06/13] xen: initialize legacy backends from xen_bus_init() Paolo Bonzini
2024-05-10 10:18 ` Philippe Mathieu-Daudé
2024-05-09 17:00 ` [PATCH 07/13] xen: register legacy backends via xen_backend_init Paolo Bonzini
2024-05-10 10:52 ` Philippe Mathieu-Daudé
2024-05-09 17:00 ` [PATCH 08/13] i386: correctly select code in hw/i386 that depends on other components Paolo Bonzini
2024-05-10 12:15 ` Zhao Liu
2024-05-09 17:00 ` [PATCH 09/13] i386: pc: remove unnecessary MachineClass overrides Paolo Bonzini
2024-05-10 12:05 ` Zhao Liu
2024-05-09 17:00 ` [PATCH 10/13] hw/i386: split x86.c in multiple parts Paolo Bonzini
2024-05-10 12:32 ` Zhao Liu
2024-05-09 17:00 ` [PATCH 11/13] hw/i386: move rtc-reset-reinjection command out of hw/rtc Paolo Bonzini
2024-05-10 12:37 ` Zhao Liu
2024-05-09 17:00 ` [PATCH 12/13] i386: select correct components for no-board build Paolo Bonzini
2024-05-10 12:40 ` Zhao Liu
2024-05-09 17:00 ` [PATCH 13/13] tests/qtest: arm: fix operation in a build without any boards or devices Paolo Bonzini
2024-05-10 5:55 ` Thomas Huth
2024-05-10 9:14 ` Philippe Mathieu-Daudé
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=d0e2ad55-52fd-4be5-ba54-f3d437c1a10f@redhat.com \
--to=thuth@redhat.com \
--cc=mhartmay@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).