qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 3/3] hw/s390x: support migration of CPI values


From: Shalini Chellathurai Saroja
Subject: [PATCH v1 3/3] hw/s390x: support migration of CPI values
Date: Wed, 15 Jan 2025 14:31:06 +0100

This commit saves the state of CPI values in the guest and
transfers this state during live migration of the guest.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
---
 hw/s390x/s390-virtio-ccw.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 35fb523af9..8fe0c5c1cb 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -259,6 +259,20 @@ static void s390_create_sclpconsole(SCLPDevice *sclp,
     qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal);
 }
 
+static const VMStateDescription vmstate_cpi = {
+    .name = "s390_cpi",
+    .version_id = 0,
+    .minimum_version_id = 0,
+    .fields = (const VMStateField[]) {
+        VMSTATE_UINT8_ARRAY(system_type, Cpi, 8),
+        VMSTATE_UINT8_ARRAY(system_name, Cpi, 8),
+        VMSTATE_UINT64(system_level, Cpi),
+        VMSTATE_UINT8_ARRAY(sysplex_name, Cpi, 8),
+        VMSTATE_UINT64(timestamp, Cpi),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static void ccw_init(MachineState *machine)
 {
     MachineClass *mc = MACHINE_GET_CLASS(machine);
@@ -307,6 +321,9 @@ static void ccw_init(MachineState *machine)
     ret = css_create_css_image(VIRTUAL_CSSID, true);
     assert(ret == 0);
 
+    /* register CPI values */
+    vmstate_register_any(NULL, &vmstate_cpi, &ms->cpi);
+
     css_register_vmstate();
 
     /* Create VirtIO network adapters */
-- 
2.47.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]