diff options
author | Andreas Färber <afaerber@suse.de> | 2013-04-15 18:34:10 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-15 17:05:34 -0500 |
commit | fe6c211781f80ef4fc246269cecbbc21981089f0 (patch) | |
tree | 02247fb8f95b6d0b87415d981a23424ce9dda73a /include/hw | |
parent | e0e367bad7170e264916cdcba4306f79f47bb95c (diff) | |
download | hqemu-fe6c211781f80ef4fc246269cecbbc21981089f0.zip hqemu-fe6c211781f80ef4fc246269cecbbc21981089f0.tar.gz |
qdev: Fix QOM unrealize behavior
Since commit 249d41720b7dfbb5951b430b9eefdbee7464f515 (qdev: Prepare
"realized" property) setting realized = true would register the device's
VMStateDescription, but realized = false would not unregister it. Fix that.
Moving the code from unparenting also revealed that we were calling
DeviceClass::init through DeviceClass::realize as interim solution but
DeviceClass::exit still at unparenting time with a realized check.
Make this symmetrical by implementing DeviceClass::unrealize to call it,
while we're setting realized = false in the unparenting path.
The only other unrealize user is mac_nvram, which can safely override it.
Thus, mark DeviceClass::exit as obsolete, new devices should implement
DeviceClass::unrealize instead.
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1366043650-9719-1-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/qdev-core.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 547fbc7..cf83d54 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -96,7 +96,7 @@ typedef struct DeviceClass { /* Private to qdev / bus. */ qdev_initfn init; /* TODO remove, once users are converted to realize */ qdev_event unplug; - qdev_event exit; + qdev_event exit; /* TODO remove, once users are converted to unrealize */ const char *bus_type; } DeviceClass; |