diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-03-20 10:51:30 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-03-20 10:51:30 +0000 |
commit | 00e7c07b06d004cf54b19724f82afde8a7a37f37 (patch) | |
tree | 06a4d0b6d4e385bc86f8118b34ecc3497a43f7a8 | |
parent | bedf13ecab38bcd479e9db6994ebc3b2c5c7a3ae (diff) | |
parent | 3c788ebc6f6eef5ac6e9cb4a28c578abcf08247d (diff) |
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170320' into staging
One bugfix for device plug/unplug and migration in the
channel subsystem code.
# gpg: Signature made Mon 20 Mar 2017 08:45:59 GMT
# gpg: using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF
* remotes/cohuck/tags/s390x-20170320:
s390x/css: reassign subchannel if schid is changed after migration
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/s390x/css.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c index e32b2a4d42..37caa98195 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1675,12 +1675,27 @@ void subch_device_save(SubchDev *s, QEMUFile *f) int subch_device_load(SubchDev *s, QEMUFile *f) { + SubchDev *old_s; + uint16_t old_schid = s->schid; int i; s->cssid = qemu_get_byte(f); s->ssid = qemu_get_byte(f); s->schid = qemu_get_be16(f); s->devno = qemu_get_be16(f); + /* Re-assign subch. */ + if (old_schid != s->schid) { + old_s = channel_subsys.css[s->cssid]->sch_set[s->ssid]->sch[old_schid]; + /* + * (old_s != s) means that some other device has its correct + * subchannel already assigned (in load). + */ + if (old_s == s) { + css_subch_assign(s->cssid, s->ssid, old_schid, s->devno, NULL); + } + /* It's OK to re-assign without a prior de-assign. */ + css_subch_assign(s->cssid, s->ssid, s->schid, s->devno, s); + } s->thinint_active = qemu_get_byte(f); /* SCHIB */ /* PMCW */ |