mirror of https://github.com/xemu-project/xemu.git
Fix pc migration from qemu <= 1.5
The following commit introduced a migration incompatibility:
commit 568f0690fd
Author: David Gibson <david@gibson.dropbear.id.au>
Date: Thu Jun 6 18:48:49 2013 +1000
pci: Replace pci_find_domain() with more general pci_root_bus_path()
The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to
0000:00.0/I440FX. Unfortunately we are stuck with the breakage for
1.6 machine types.
Add a compat property to maintain the busted idstr for the 1.6 machine
types, but revert to the old style format for 1.7+, and <= 1.5.
Tested with migration from qemu 1.5, qemu 1.6, and qemu.git.
Cc: qemu-stable@nongnu.org
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
c2d3066776
commit
04c7d8b8de
|
@ -48,6 +48,7 @@ typedef struct I440FXState {
|
||||||
PCIHostState parent_obj;
|
PCIHostState parent_obj;
|
||||||
PcPciInfo pci_info;
|
PcPciInfo pci_info;
|
||||||
uint64_t pci_hole64_size;
|
uint64_t pci_hole64_size;
|
||||||
|
uint32_t short_root_bus;
|
||||||
} I440FXState;
|
} I440FXState;
|
||||||
|
|
||||||
#define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */
|
#define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */
|
||||||
|
@ -720,13 +721,19 @@ static const TypeInfo i440fx_info = {
|
||||||
static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge,
|
static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge,
|
||||||
PCIBus *rootbus)
|
PCIBus *rootbus)
|
||||||
{
|
{
|
||||||
|
I440FXState *s = I440FX_PCI_HOST_BRIDGE(host_bridge);
|
||||||
|
|
||||||
/* For backwards compat with old device paths */
|
/* For backwards compat with old device paths */
|
||||||
return "0000";
|
if (s->short_root_bus) {
|
||||||
|
return "0000";
|
||||||
|
}
|
||||||
|
return "0000:00";
|
||||||
}
|
}
|
||||||
|
|
||||||
static Property i440fx_props[] = {
|
static Property i440fx_props[] = {
|
||||||
DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState,
|
DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState,
|
||||||
pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
|
pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
|
||||||
|
DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,13 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
|
||||||
static const char *q35_host_root_bus_path(PCIHostState *host_bridge,
|
static const char *q35_host_root_bus_path(PCIHostState *host_bridge,
|
||||||
PCIBus *rootbus)
|
PCIBus *rootbus)
|
||||||
{
|
{
|
||||||
/* For backwards compat with old device paths */
|
Q35PCIHost *s = Q35_HOST_DEVICE(host_bridge);
|
||||||
return "0000";
|
|
||||||
|
/* For backwards compat with old device paths */
|
||||||
|
if (s->mch.short_root_bus) {
|
||||||
|
return "0000";
|
||||||
|
}
|
||||||
|
return "0000:00";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void q35_host_get_pci_hole_start(Object *obj, Visitor *v,
|
static void q35_host_get_pci_hole_start(Object *obj, Visitor *v,
|
||||||
|
@ -124,6 +129,7 @@ static Property mch_props[] = {
|
||||||
MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT),
|
MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT),
|
||||||
DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35PCIHost,
|
DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35PCIHost,
|
||||||
mch.pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
|
mch.pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
|
||||||
|
DEFINE_PROP_UINT32("short_root_bus", Q35PCIHost, mch.short_root_bus, 0),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -260,6 +260,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
|
||||||
.driver = "qemu32-" TYPE_X86_CPU,\
|
.driver = "qemu32-" TYPE_X86_CPU,\
|
||||||
.property = "model",\
|
.property = "model",\
|
||||||
.value = stringify(3),\
|
.value = stringify(3),\
|
||||||
|
},{\
|
||||||
|
.driver = "i440FX-pcihost",\
|
||||||
|
.property = "short_root_bus",\
|
||||||
|
.value = stringify(1),\
|
||||||
|
},{\
|
||||||
|
.driver = "q35-pcihost",\
|
||||||
|
.property = "short_root_bus",\
|
||||||
|
.value = stringify(1),\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PC_COMPAT_1_5 \
|
#define PC_COMPAT_1_5 \
|
||||||
|
@ -296,6 +304,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
|
||||||
.driver = TYPE_X86_CPU,\
|
.driver = TYPE_X86_CPU,\
|
||||||
.property = "pmu",\
|
.property = "pmu",\
|
||||||
.value = "on",\
|
.value = "on",\
|
||||||
|
},{\
|
||||||
|
.driver = "i440FX-pcihost",\
|
||||||
|
.property = "short_root_bus",\
|
||||||
|
.value = stringify(0),\
|
||||||
|
},{\
|
||||||
|
.driver = "q35-pcihost",\
|
||||||
|
.property = "short_root_bus",\
|
||||||
|
.value = stringify(0),\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PC_COMPAT_1_4 \
|
#define PC_COMPAT_1_4 \
|
||||||
|
|
|
@ -61,6 +61,7 @@ typedef struct MCHPCIState {
|
||||||
ram_addr_t above_4g_mem_size;
|
ram_addr_t above_4g_mem_size;
|
||||||
uint64_t pci_hole64_size;
|
uint64_t pci_hole64_size;
|
||||||
PcGuestInfo *guest_info;
|
PcGuestInfo *guest_info;
|
||||||
|
uint32_t short_root_bus;
|
||||||
} MCHPCIState;
|
} MCHPCIState;
|
||||||
|
|
||||||
typedef struct Q35PCIHost {
|
typedef struct Q35PCIHost {
|
||||||
|
|
Loading…
Reference in New Issue