qemu/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 STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
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 chardev: qom-ify 2017-01-27 18:08:00 +01:00
char s390x/3270: Mark non-migratable and enable the device 2017-05-04 10:34:37 +02:00
core numa: Silence incomplete mapping warning under qtest 2017-05-22 14:24:52 -03:00
cpu Introduce DEVICE_CATEGORY_CPU for CPU devices 2017-01-27 18:07:31 +01:00
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
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 ipack: Update e-mail address 2016-05-18 15:04:27 +03:00
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 char: rename CharDriverState Chardev 2017-01-27 18:07:59 +01:00
m68k hw/m68k: QOMify the ColdFire interrupt controller 2017-02-18 22:23:31 +01:00
mem pc: memhp: enable nvdimm device hotplug 2016-11-01 19:21:09 +02:00
microblaze Remove reduntant qemu: from error functions 2017-05-07 09:57:51 +03:00
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 hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
net virtio_net: Bypass backends for MTU feature negotiation 2017-05-25 21:25:28 +03:00
nios2 Remove reduntant qemu: from error functions 2017-05-07 09:57:51 +03:00
nvram fw_cfg: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
openrisc target/openrisc: Support non-busy idle state using PMR SPR 2017-05-04 09:39:14 +09:00
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 hw: Clean up includes 2016-01-29 15:07:25 +00:00
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 stubs: move smbios stubs to hw/smbios 2017-01-16 17:52:35 +01:00
sparc tcx: switch to load_image_mr() and remove prom_addr hack 2017-04-21 09:02:04 +01:00
sparc64 sparc/sparc64: grab BQL before calling cpu_check_irqs 2017-03-09 10:41:38 +00:00
ssi aspeed/smc: use a modulo to check segment limits 2017-02-10 17:40:30 +00:00
timer shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
tpm clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
tricore Remove reduntant qemu: from error functions 2017-05-07 09:57:51 +03:00
unicore32 clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
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 acpi: filter based on CONFIG_ACPI_X86 rather than TARGET 2017-01-16 17:52:35 +01:00