aboutsummaryrefslogtreecommitdiff
path: root/hw/fdc.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-12-15 14:34:35 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-18 11:26:33 -0600
commit47f5ba724871622c7db7a73fd05d6b3646478dd6 (patch)
tree9fb61838802dc257e89df5fa49f9855e97500f2f /hw/fdc.c
parentaef30c3c6a3165178584eb125f64defd8173eebd (diff)
fdc: fix migration from 0.11
0.11 uses as instance ide io_base, get it back Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/fdc.c')
-rw-r--r--hw/fdc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/fdc.c b/hw/fdc.c
index 1352dc447d..0579b03728 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1907,7 +1907,7 @@ fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,
return fdctrl;
}
-static int fdctrl_init_common(fdctrl_t *fdctrl)
+static int fdctrl_init_common(fdctrl_t *fdctrl, target_phys_addr_t io_base)
{
int i, j;
static int command_tables_inited = 0;
@@ -1938,6 +1938,7 @@ static int fdctrl_init_common(fdctrl_t *fdctrl)
DMA_register_channel(fdctrl->dma_chann, &fdctrl_transfer_handler, fdctrl);
fdctrl_connect_drives(fdctrl);
+ vmstate_register(io_base, &vmstate_fdc, fdctrl);
return 0;
}
@@ -1961,7 +1962,7 @@ static int isabus_fdc_init1(ISADevice *dev)
isa_init_irq(&isa->busdev, &fdctrl->irq, isairq);
fdctrl->dma_chann = dma_chann;
- ret = fdctrl_init_common(fdctrl);
+ ret = fdctrl_init_common(fdctrl, iobase);
return ret;
}
@@ -1979,7 +1980,7 @@ static int sysbus_fdc_init1(SysBusDevice *dev)
qdev_init_gpio_in(&dev->qdev, fdctrl_handle_tc, 1);
fdctrl->dma_chann = -1;
- ret = fdctrl_init_common(fdctrl);
+ ret = fdctrl_init_common(fdctrl, io);
return ret;
}
@@ -1996,7 +1997,7 @@ static int sun4m_fdc_init1(SysBusDevice *dev)
qdev_init_gpio_in(&dev->qdev, fdctrl_handle_tc, 1);
fdctrl->sun4m = 1;
- return fdctrl_init_common(fdctrl);
+ return fdctrl_init_common(fdctrl, io);
}
static ISADeviceInfo isa_fdc_info = {
@@ -2004,7 +2005,6 @@ static ISADeviceInfo isa_fdc_info = {
.qdev.name = "isa-fdc",
.qdev.size = sizeof(fdctrl_isabus_t),
.qdev.no_user = 1,
- .qdev.vmsd = &vmstate_fdc,
.qdev.reset = fdctrl_external_reset_isa,
.qdev.props = (Property[]) {
DEFINE_PROP_DRIVE("driveA", fdctrl_isabus_t, state.drives[0].dinfo),
@@ -2017,7 +2017,6 @@ static SysBusDeviceInfo sysbus_fdc_info = {
.init = sysbus_fdc_init1,
.qdev.name = "sysbus-fdc",
.qdev.size = sizeof(fdctrl_sysbus_t),
- .qdev.vmsd = &vmstate_fdc,
.qdev.reset = fdctrl_external_reset_sysbus,
.qdev.props = (Property[]) {
DEFINE_PROP_DRIVE("driveA", fdctrl_sysbus_t, state.drives[0].dinfo),
@@ -2030,7 +2029,6 @@ static SysBusDeviceInfo sun4m_fdc_info = {
.init = sun4m_fdc_init1,
.qdev.name = "SUNW,fdtwo",
.qdev.size = sizeof(fdctrl_sysbus_t),
- .qdev.vmsd = &vmstate_fdc,
.qdev.reset = fdctrl_external_reset_sysbus,
.qdev.props = (Property[]) {
DEFINE_PROP_DRIVE("drive", fdctrl_sysbus_t, state.drives[0].dinfo),