aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index ebddcaedbd..3ce69be47e 100644
--- 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);