aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-07-24 19:38:36 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-07-29 08:17:40 -0500
commit5ab28c8340f683121c081a181adfd9f72ab85cba (patch)
treede5ec36022dbdb0a391aa2d19bd93f3975e680ae
parentc886edfb851c0c590d4e77f058f2ec8ed95ad1b5 (diff)
qdev: Reset hot-plugged devices
Device models rely on the core invoking their reset handlers after init. We do this in the cold-plug case, but so far we miss this step after hot-plug. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/qdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index a0fcd06094..b4ea8e13d1 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -289,6 +289,9 @@ int qdev_init(DeviceState *dev)
dev->alias_required_for_version);
}
dev->state = DEV_STATE_INITIALIZED;
+ if (dev->hotplugged && dev->info->reset) {
+ dev->info->reset(dev);
+ }
return 0;
}