This patch fixes save/load of pcie slot which was broken by cd870502e228f8f028f93fb585ae3b208fcb46c7.
Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp> --- hw/ioh3420.c | 1 + hw/pcie.c | 7 +++++++ hw/pcie.h | 1 + hw/xio3130_downstream.c | 1 + 4 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/ioh3420.c b/hw/ioh3420.c index 23aecbf..3cc129f 100644 --- a/hw/ioh3420.c +++ b/hw/ioh3420.c @@ -139,6 +139,7 @@ static const VMStateDescription vmstate_ioh3420 = { .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, + .post_load = pcie_cap_slot_post_load, .fields = (VMStateField[]) { VMSTATE_PCIE_DEVICE(port.br.dev, PCIESlot), /* TODO: AER */ diff --git a/hw/pcie.c b/hw/pcie.c index 97d17fa..23e35dc 100644 --- a/hw/pcie.c +++ b/hw/pcie.c @@ -343,6 +343,13 @@ void pcie_cap_slot_write_config(PCIDevice *dev, } } +int pcie_cap_slot_post_load(void *opaque, int version_id) +{ + PCIDevice *dev = opaque; + hotplug_event_update_event_status(dev); + return 0; +} + void pcie_cap_slot_push_attention_button(PCIDevice *dev) { pcie_cap_slot_event(dev, PCI_EXP_HP_EV_ABP); diff --git a/hw/pcie.h b/hw/pcie.h index 39c6e47..8708504 100644 --- a/hw/pcie.h +++ b/hw/pcie.h @@ -95,6 +95,7 @@ void pcie_cap_slot_init(PCIDevice *dev, uint16_t slot); void pcie_cap_slot_reset(PCIDevice *dev); void pcie_cap_slot_write_config(PCIDevice *dev, uint32_t addr, uint32_t val, int len); +int pcie_cap_slot_post_load(void *opaque, int version_id); void pcie_cap_slot_push_attention_button(PCIDevice *dev); void pcie_cap_root_init(PCIDevice *dev); diff --git a/hw/xio3130_downstream.c b/hw/xio3130_downstream.c index d46f911..854eba8 100644 --- a/hw/xio3130_downstream.c +++ b/hw/xio3130_downstream.c @@ -141,6 +141,7 @@ static const VMStateDescription vmstate_xio3130_downstream = { .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, + .post_load = pcie_cap_slot_post_load, .fields = (VMStateField[]) { VMSTATE_PCIE_DEVICE(port.br.dev, PCIESlot), /* TODO: AER */ -- 1.7.1.1