qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] hw/i386/postcard.c: New ISA POST card device


From: Paolo Bonzini
Subject: Re: [PATCH v2 1/2] hw/i386/postcard.c: New ISA POST card device
Date: Thu, 3 Nov 2022 19:13:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]