OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7fc2f2c
)
qdev: integrate reset
author
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 1 Sep 2009 07:56:12 +0000
(09:56 +0200)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Wed, 9 Sep 2009 19:57:20 +0000
(14:57 -0500)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev.c
patch
|
blob
|
history
hw/qdev.h
patch
|
blob
|
history
diff --git
a/hw/qdev.c
b/hw/qdev.c
index
0e9732b
..
675248f
100644
(file)
--- a/
hw/qdev.c
+++ b/
hw/qdev.c
@@
-214,12
+214,21
@@
DeviceState *qdev_device_add(QemuOpts *opts)
calling this function. */
int qdev_init(DeviceState *dev)
{
- return dev->info->init(dev, dev->info);
+ int rc;
+
+ rc = dev->info->init(dev, dev->info);
+ if (rc < 0)
+ return rc;
+ if (dev->info->reset)
+ qemu_register_reset(dev->info->reset, dev);
+ return 0;
}
/* Unlink device from bus and free the structure. */
void qdev_free(DeviceState *dev)
{
+ if (dev->info->reset)
+ qemu_unregister_reset(dev->info->reset, dev);
LIST_REMOVE(dev, sibling);
qemu_free(dev);
}
diff --git
a/hw/qdev.h
b/hw/qdev.h
index
56a0c1f
..
b146aa1
100644
(file)
--- a/
hw/qdev.h
+++ b/
hw/qdev.h
@@
-108,6
+108,9
@@
struct DeviceInfo {
Property *props;
int no_user;
+ /* callbacks */
+ QEMUResetHandler *reset;
+
/* Private to qdev / bus. */
qdev_initfn init;
BusInfo *bus_info;