qdev: Check if unplug handler exists before calling it
commit593831de5dce5f5b9ce1226e0d8353eecb1176e4
authorAmit Shah <amit.shah@redhat.com>
Mon, 2 Nov 2009 09:26:41 +0000 (2 14:56 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 12 Nov 2009 17:23:54 +0000 (12 11:23 -0600)
treebbde500fae21a8563be891a4ef3b8cd7c5d2de46
parent88e2b0a5fd320f58f1a8aa1e19b502376854d879
qdev: Check if unplug handler exists before calling it

A bus may have hotplugging enabled but not have the 'unplug'
callback defined, which would lead to a crash on trying to
unplug a device on the bus.

Fix by introducing an assert to check if the callback is valid.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev.c