qemu-patch-raspberry4/hw/i386
Olaf Hering 9a709f06c8 piix: fix xenfv regression, add compat machine xenfv-4.2
With QEMU 4.0 an incompatible change was added to pc_piix, which makes it
practical impossible to migrate domUs started with qemu2 or qemu3 to
newer qemu versions. Commit 7fccf2a068
added and enabled a new member "smbus_no_migration_support". In commit
4ab2f2a8aa the vmstate_acpi got new
elements, which are conditionally filled. As a result, an incoming
migration expected smbus related data unless smbus migration was
disabled for a given MachineClass. Since first commit forgot to handle
'xenfv', domUs started with QEMU 4.x are incompatible with their QEMU
siblings.

Using other existing machine types, such as 'pc-i440fx-3.1', is not
possible because 'xenfv' creates the 'xen-platform' PCI device at
00:02.0, while all other variants to run a domU would create it at
00:04.0.

To cover both the existing and the broken case of 'xenfv' in a single
qemu binary, a new compatibility variant of 'xenfv-4.2' must be added
which targets domUs started with qemu 4.2. The existing 'xenfv' restores
compatibility of QEMU 5.x with qemu 3.1.

Host admins who started domUs with QEMU 4.x (preferrable QEMU 4.2)
have to use a wrapper script which appends '-machine xenfv-4.2' to
the device-model command line.  This is only required if there is no
maintenance window which allows to temporary shutdown the domU and
restart it with a fixed device-model.

The wrapper script is as simple as this:
  #!/bin/sh
  exec /usr/bin/qemu-system-i386 "$@" -machine xenfv-4.2

With xl this script will be enabled with device_model_override=, see
xl.cfg(5). To live migrate a domU, adjust the existing domU.cfg and pass
it to xl migrate or xl save/restore:
  xl migrate -C new-domU.cfg domU remote-host
  xl save domU CheckpointFile new-domU.cfg
  xl restore new-domU.cfg CheckpointFile

With libvirt this script will be enabled with the <emulator> element in
domU.xml. Use 'virsh edit' prior 'virsh migrate' to replace the existing
<emulator> element to point it to the wrapper script.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Message-Id: <20200327151841.13877-1-olaf@aepfle.de>
[Adjust tests for blacklisted machine types, simplifying the one in
 qom-test. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-04-11 08:49:11 -04:00
..
kvm qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xen qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
acpi-build.c acpi: add acpi=OnOffAuto machine property to x86 and arm virt 2020-03-29 09:52:13 -04:00
acpi-build.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
amd_iommu.c hw/i386/amd_iommu.c: Fix corruption of log events passed to guest 2020-03-29 09:52:13 -04:00
amd_iommu.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
e820_memory_layout.c hw/i386/pc: Extract e820 memory layout code 2019-09-16 17:13:07 +02:00
e820_memory_layout.h hw/i386/pc: Extract e820 memory layout code 2019-09-16 17:13:07 +02:00
fw_cfg.c x86: move more x86-generic functions out of PC files 2019-12-17 19:33:50 +01:00
fw_cfg.h x86: move more x86-generic functions out of PC files 2019-12-17 19:33:50 +01:00
intel_iommu.c hw/i386/intel_iommu: Fix out-of-bounds access on guest IRT 2020-03-16 23:02:22 +01:00
intel_iommu_internal.h intel_iommu: add present bit check for pasid table entries 2020-01-06 12:04:51 -05:00
Kconfig tpm: Separate TPM_TIS and TPM_TIS_ISA configs 2020-03-05 12:18:00 -05:00
kvmvapic.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
Makefile.objs hw/i386/pc: Extract the port92 device 2019-12-17 19:33:51 +01:00
microvm.c x86/microvm: use memdev for RAM 2020-02-19 16:49:58 +00:00
multiboot.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c i386: Fix pkg_id offset for EPYC cpu models 2020-03-31 19:13:32 -03:00
pc_piix.c piix: fix xenfv regression, add compat machine xenfv-4.2 2020-04-11 08:49:11 -04:00
pc_q35.c hw/i386: Include "hw/mem/nvdimm.h" 2020-03-09 15:59:31 +01:00
pc_sysfw.c hw/i386/pc: move shared x86 functions to x86.c and export them 2019-10-22 09:38:42 +02:00
port92.c hw/i386/pc: Extract the port92 device 2019-12-17 19:33:51 +01:00
trace-events hw/i386/pc: Extract the port92 device 2019-12-17 19:33:51 +01:00
vmmouse.c hw/i386/vmmouse: Fix crash when using the vmmouse on a machine without vmport 2020-02-06 11:02:48 +01:00
vmport.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
x86-iommu-stub.c hw/i386/x86-iommu: Add missing stubs 2020-01-09 11:41:25 +00:00
x86-iommu.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
x86.c hw/i386: Move arch_id decode inside x86_cpus_init 2020-03-31 19:13:32 -03:00