[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 24/24] store a pointer to QemuOpts in DeviceState, r
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 24/24] store a pointer to QemuOpts in DeviceState, release it when zapping a device. |
Date: |
Fri, 25 Sep 2009 21:42:49 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/qdev.c | 3 +++
hw/qdev.h | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 00cb849..ae24df7 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);
diff --git a/hw/qdev.h b/hw/qdev.h
index 8b6e4fe..1884160 100644
--- 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;
--
1.6.2.5
- [Qemu-devel] [PATCH 14/24] usb: hook unplug into qdev, cleanups + fixes., (continued)
- [Qemu-devel] [PATCH 14/24] usb: hook unplug into qdev, cleanups + fixes., Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 17/24] usb: hotplug windup, Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 23/24] allow if=none for drive_add, Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 19/24] pci: hotplug windup, Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 15/24] switch qemu-config to qemu_error, Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 21/24] drive cleanup fixes., Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 18/24] scsi: hotplug windup, Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 22/24] refactor drive_hot_add, Gerd Hoffmann, 2009/09/25
- [Qemu-devel] [PATCH 24/24] store a pointer to QemuOpts in DeviceState, release it when zapping a device.,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 16/24] qdev hotplug: infrastructure and monitor commands., Gerd Hoffmann, 2009/09/25
[Qemu-devel] [PATCH 20/24] pci: windup acpi-based hotplug, Gerd Hoffmann, 2009/09/25
Re: [Qemu-devel] [PATCH 00/24] qdev: bus management updates., Anthony Liguori, 2009/09/25
Re: [Qemu-devel] [PATCH 00/24] qdev: bus management updates., Markus Armbruster, 2009/09/28