Replace MicroDriveState legacy reset by device_reset_warm. The new function propagates also the reset to the sub-buses tree. The MicroDriveState has a child bus so it is now reset automatically as well as all the qdev sub tree. It seems to me that IDE_BUS and IDE_DEVICEs reset methods are not implemented so resetting the qdev/qbus ide tree will have no effect.
Keep the explicit call to ide_bus_reset (in md_reset function) since it is not called when using the standard reset method of the IDE_BUS object. Signed-off-by: Damien Hedde <damien.he...@greensocs.com> --- hw/ide/microdrive.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index fc346f5ad5..afe2342da8 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -173,7 +173,7 @@ static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t value) case 0x00: /* Configuration Option Register */ s->opt = value & 0xcf; if (value & OPT_SRESET) { - device_legacy_reset(DEVICE(s)); + device_reset_warm(DEVICE(s)); } md_interrupt_update(s); break; @@ -316,7 +316,7 @@ static void md_common_write(PCMCIACardState *card, uint32_t at, uint16_t value) case 0xe: /* Device Control */ s->ctrl = value; if (value & CTRL_SRST) { - device_legacy_reset(DEVICE(s)); + device_reset_warm(DEVICE(s)); } md_interrupt_update(s); break; @@ -541,7 +541,7 @@ static int dscm1xxxx_attach(PCMCIACardState *card) md->attr_base = pcc->cis[0x74] | (pcc->cis[0x76] << 8); md->io_base = 0x0; - device_legacy_reset(DEVICE(md)); + device_reset_warm(DEVICE(md)); md_interrupt_update(md); return 0; @@ -551,7 +551,7 @@ static int dscm1xxxx_detach(PCMCIACardState *card) { MicroDriveState *md = MICRODRIVE(card); - device_legacy_reset(DEVICE(md)); + device_reset_warm(DEVICE(md)); return 0; } -- 2.22.0