On 7/7/22 02:37, Lev Kujawski wrote:
@@ -1139,12 +1120,10 @@ void pc_basic_device_init(struct PCMachineState *pcms,
qemu_irq pit_alt_irq = NULL;
qemu_irq rtc_irq = NULL;
ISADevice *pit = NULL;
- MemoryRegion *ioport80_io = g_new(MemoryRegion, 1);
MemoryRegion *ioportF0_io = g_new(MemoryRegion, 1);
X86MachineState *x86ms = X86_MACHINE(pcms);
- memory_region_init_io(ioport80_io, NULL, &ioport80_io_ops, NULL, "ioport80", 1);
- memory_region_add_subregion(isa_bus->address_space_io, 0x80, ioport80_io);
+ (void)post_card_init(isa_bus, POST_CARD_PORT_DEFAULT);
This unfortunately breaks live migration of old machine types (new QEMU
to old QEMU).
The simplest (though not very simple) way to do it is to add a new
property to the machine (e.g. "postcard-rw") and keep the old
ioport80_io_ops if the property is false. Default the property to true,
and in hw/i386/pc.c make the property false with an entry like
{ TYPE_PC_MACHINE "postcard-rw", "off" },
in pc_compat_7_1.
+ VMSTATE_UINT16(port, POSTCardState),
port doesn't have to be stored.
Paolo