@@ -1786,12 +1786,22 @@ static void ipmi_sim_realize(DeviceState *dev, Error **errp)
vmstate_register(NULL, 0, &vmstate_ipmi_sim, ibs);
}
+static void ipmi_sim_unrealize(DeviceState *dev, Error **errp)
+{
+ IPMIBmc *b = IPMI_BMC(dev);
+ IPMIBmcSim *ibs = IPMI_BMC_SIMULATOR(b);
+
+ timer_del(ibs->timer);
+ timer_free(ibs->timer);
+}
+
static void ipmi_sim_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
IPMIBmcClass *bk = IPMI_BMC_CLASS(oc);
dc->realize = ipmi_sim_realize;
+ dc->unrealize = ipmi_sim_unrealize;
bk->handle_command = ipmi_sim_handle_command;
}