qdev: fix device_del by refactoring reference counting
authorAnthony Liguori <aliguori@us.ibm.com>
Fri, 13 Jan 2012 13:45:55 +0000 (07:45 -0600)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 13 Jan 2012 16:20:49 +0000 (10:20 -0600)
commit024a6fbdb9d8cbc4d7f833b23db51c9d1004bc47
treeeb591e7b73c900dca6ddbcbc5f1c877f873ac705
parent607a2c72e52d6a7050c0eae1076b0b2976180d3e
qdev: fix device_del by refactoring reference counting

Commit 8eb0283 broken device_del by having too overzealous reference counting
checks.  Move the reference count checks to qdev_free(), make sure to remove
the parent link on free, and decrement the reference count on property removal.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev.c