]> git.proxmox.com Git - mirror_qemu.git/commitdiff
css: mss/mcss-e vs. migration
authorCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 24 Jun 2015 08:57:23 +0000 (10:57 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Tue, 30 Jun 2015 07:34:57 +0000 (09:34 +0200)
Our main channel_subsys structure is not a device (yet), but we need
to setup mss/mcss-e again if the guest had enabled it before. Use
a hack that should catch most configurations (assuming that the guest
will have enabled at least one device in higher subchannel sets or
channel subsystems if it enabled the functionality.)

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/css.c

index 5561d807dc74e571fc58182a23f027826a5ab77d..a9cf3d7f973c5662067945542de88aa514b4b753 100644 (file)
@@ -1464,6 +1464,21 @@ int subch_device_load(SubchDev *s, QEMUFile *f)
     }
     s->ccw_fmt_1 = qemu_get_byte(f);
     s->ccw_no_data_cnt = qemu_get_byte(f);
+    /*
+     * Hack alert. We don't migrate the channel subsystem status (no
+     * device!), but we need to find out if the guest enabled mss/mcss-e.
+     * If the subchannel is enabled, it certainly was able to access it,
+     * so adjust the max_ssid/max_cssid values for relevant ssid/cssid
+     * values. This is not watertight, but better than nothing.
+     */
+    if (s->curr_status.pmcw.flags & PMCW_FLAGS_MASK_ENA) {
+        if (s->ssid) {
+            channel_subsys->max_ssid = MAX_SSID;
+        }
+        if (s->cssid != channel_subsys->default_cssid) {
+            channel_subsys->max_cssid = MAX_CSSID;
+        }
+    }
     return 0;
 }