projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7101174
)
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
author
Gerd Hoffmann
<kraxel@redhat.com>
Fri, 25 Sep 2009 19:42:49 +0000
(21:42 +0200)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Mon, 5 Oct 2009 14:32:49 +0000
(09:32 -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
ebddcae
..
3ce69be
100644
(file)
--- a/
hw/qdev.c
+++ b/
hw/qdev.c
@@
-218,6
+218,7
@@
DeviceState *qdev_device_add(QemuOpts *opts)
qdev_free(qdev);
return NULL;
}
+ qdev->opts = opts;
return qdev;
}
@@
-276,6
+277,8
@@
void qdev_free(DeviceState *dev)
qemu_unregister_reset(dev->info->reset, dev);
if (dev->info->exit)
dev->info->exit(dev);
+ if (dev->opts)
+ qemu_opts_del(dev->opts);
}
QLIST_REMOVE(dev, sibling);
qemu_free(dev);
diff --git
a/hw/qdev.h
b/hw/qdev.h
index
ca7c21a
..
7da7837
100644
(file)
--- a/
hw/qdev.h
+++ b/
hw/qdev.h
@@
-29,6
+29,7
@@
enum DevState {
struct DeviceState {
const char *id;
enum DevState state;
+ QemuOpts *opts;
int hotplugged;
DeviceInfo *info;
BusState *parent_bus;