]> Git Repo - qemu.git/commitdiff
qdev: Reset hot-plugged devices
authorJan Kiszka <[email protected]>
Sun, 24 Jul 2011 17:38:36 +0000 (19:38 +0200)
committerAnthony Liguori <[email protected]>
Fri, 29 Jul 2011 13:17:40 +0000 (08:17 -0500)
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 <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
hw/qdev.c

index a0fcd0609424ec468e843219cdac2c87e82aed06..b4ea8e13d16f253be9e9b15c054056a7691ec6cb 100644 (file)
--- 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;
 }
 
This page took 0.03011 seconds and 4 git commands to generate.