mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
7101174e5c
commit
ef80b46623
2 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -29,6 +29,7 @@ enum DevState {
|
|||
struct DeviceState {
|
||||
const char *id;
|
||||
enum DevState state;
|
||||
QemuOpts *opts;
|
||||
int hotplugged;
|
||||
DeviceInfo *info;
|
||||
BusState *parent_bus;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue