From: Jan Kiszka Date: Sun, 24 Jul 2011 17:38:36 +0000 (+0200) Subject: qdev: Reset hot-plugged devices X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5ab28c8340f683121c081a181adfd9f72ab85cba;p=qemu.git 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 Signed-off-by: Anthony Liguori --- 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; }