From: Shalini Chellathurai Saroja Date: Mon, 16 Jun 2025 14:01:07 +0000 (+0200) Subject: hw/s390x: support migration of CPI data X-Git-Tag: v10.1.0-rc0~41^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c61927ba8e4375fcb80aef9d9bc9e32b8130af01;p=thirdparty%2Fqemu.git hw/s390x: support migration of CPI data Register Control-Program Identification data with the live migration infrastructure. Signed-off-by: Shalini Chellathurai Saroja Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Thomas Huth Message-ID: <20250616140107.990538-4-shalini@linux.ibm.com> Signed-off-by: Thomas Huth --- diff --git a/hw/s390x/sclpcpi.c b/hw/s390x/sclpcpi.c index 440a5ff1eb6..7aa039d5100 100644 --- a/hw/s390x/sclpcpi.c +++ b/hw/s390x/sclpcpi.c @@ -54,6 +54,7 @@ #include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" #include "qapi/qapi-visit-machine.h" +#include "migration/vmstate.h" typedef struct Data { uint8_t id_format; @@ -145,12 +146,26 @@ static void get_timestamp(Object *obj, Visitor *v, const char *name, visit_type_uint64(v, name, &e->timestamp, errp); } +static const VMStateDescription vmstate_sclpcpi = { + .name = "s390_control_program_id", + .version_id = 0, + .fields = (const VMStateField[]) { + VMSTATE_UINT8_ARRAY(system_type, SCLPEventCPI, 8), + VMSTATE_UINT8_ARRAY(system_name, SCLPEventCPI, 8), + VMSTATE_UINT64(system_level, SCLPEventCPI), + VMSTATE_UINT8_ARRAY(sysplex_name, SCLPEventCPI, 8), + VMSTATE_UINT64(timestamp, SCLPEventCPI), + VMSTATE_END_OF_LIST() + } +}; + static void cpi_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc = DEVICE_CLASS(klass); SCLPEventClass *k = SCLP_EVENT_CLASS(klass); dc->user_creatable = false; + dc->vmsd = &vmstate_sclpcpi; k->can_handle_event = can_handle_event; k->get_send_mask = send_mask;