qemu-e2k/hw
Halil Pasic 8ed179c937 s390x/css: catch section mismatch on load
Prior to the virtio-ccw-2.7 machine (and commit 2a79eb1a), our virtio
devices residing under the virtual-css bus do not have qdev_path based
migration stream identifiers (because their qdev_path is NULL). The ids
are instead generated when the device is registered as a composition of
the so called idstr, which takes the vmsd name as its value, and an
instance_id, which is which is calculated as a maximal instance_id
registered with the same idstr plus one, or zero (if none was registered
previously).

That means, under certain circumstances, one device might try, and even
succeed, to load the state of a different device. This can lead to
trouble.

Let us fail the migration if the above problem is detected during load.

How to reproduce the problem:
1) start qemu-system-s390x making sure you have the following devices
   defined on your command line:
     -device virtio-rng-ccw,id=rng1,devno=fe.0.0001
     -device virtio-rng-ccw,id=rng2,devno=fe.0.0002
2) detach the devices and reattach in reverse order using the monitor:
     (qemu) device_del rng1
     (qemu) device_del rng2
     (qemu) device_add virtio-rng-ccw,id=rng2,devno=fe.0.0002
     (qemu) device_add virtio-rng-ccw,id=rng1,devno=fe.0.0001
3) save the state of the vm into a temporary file and quit QEMU:
     (qemu) migrate "exec:gzip -c > /tmp/tmp_vmstate.gz"
     (qemu) q
4) use your command line from step 1 with
     -incoming "exec:gzip -c -d /tmp/tmp_vmstate.gz"
   appended to reproduce the problem (while trying to to load the saved vm)

CC: qemu-stable@nongnu.org
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-Id: <20170518111405.56947-1-pasic@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-06-06 10:16:46 +02:00
..
9pfs migration/next for 20170517 2017-05-18 10:05:52 +01:00
acpi shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
adc
alpha memory: tune last param of iommu_ops.translate() 2017-05-25 21:25:27 +03:00
arm shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
audio audio: Rename hw/audio/audio.h to hw/audio/soundhw.h 2017-05-19 10:48:54 +02:00
block nvme: Add support for Controller Memory Buffers 2017-05-26 16:48:21 +02:00
bt
char
core numa: Silence incomplete mapping warning under qtest 2017-05-22 14:24:52 -03:00
cpu
cris
display migration: Create migration/blocker.h 2017-05-17 12:04:59 +02:00
dma memory: tune last param of iommu_ops.translate() 2017-05-25 21:25:27 +03:00
gpio qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
i2c qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
i386 pci, virtio, vhost: fixes 2017-05-30 14:15:04 +01:00
ide allwinner-ahci: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
input shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
intc xics: add unrealize handler 2017-05-25 11:31:33 +10:00
ipack
ipmi shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
isa shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
lm32
m68k
mem
microblaze
mips shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
misc shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
moxie
net virtio_net: Bypass backends for MTU feature negotiation 2017-05-25 21:25:28 +03:00
nios2
nvram fw_cfg: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
openrisc
pci pci: deassert intx when pci device unrealize 2017-05-18 00:35:15 +03:00
pci-bridge pci, virtio, vhost: fixes 2017-05-18 10:01:08 +01:00
pci-host pci, virtio, vhost: fixes 2017-05-30 14:15:04 +01:00
pcmcia
ppc pci, virtio, vhost: fixes 2017-05-30 14:15:04 +01:00
s390x s390x/css: catch section mismatch on load 2017-06-06 10:16:46 +02:00
scsi esp: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
sd generic-sdhci: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
sh4 shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
smbios
sparc
sparc64
ssi
timer shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
tpm
tricore
unicore32
usb ehci: fix frame timer invocation. 2017-05-29 14:19:16 +02:00
vfio pci, virtio, vhost: fixes 2017-05-30 14:15:04 +01:00
virtio vhost-user: pass message as a pointer to process_message_reply() 2017-05-25 21:25:28 +03:00
watchdog shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
xen xen-sysdev: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
xenpv shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
xtensa shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
Makefile.objs