> I think we should do
> 
> s->vmstate = qemu_add_vm_change_state_handler(ide_restart_cb, bus);
> instead of
> qemu_add_vm_change_state_handler(ide_restart_cb, bus);
> 
> in ide_register_restart_cb() in hw/ide/core.c to store the returned
> pointer to memory to avoid a possible memory leak I guess and
> introduce a VMChangeStateEntry field in struct AHCIState to handle
> this. Same can then further be used with
> qemu_del_vm_change_state_handler() in ahci_unrealize() to free things
> up.

Yes, this is correct. Thanks!

Paolo

Reply via email to