[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/14] qdev: remove opts pointer tracking
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 05/14] qdev: remove opts pointer tracking |
Date: |
Fri, 16 Sep 2011 11:00:25 -0500 |
This was only used because id's memory was stored in opts.
Signed-off-by: Anthony Liguori <address@hidden>
---
hw/qdev.c | 5 ++---
hw/qdev.h | 1 -
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 41ed872..3096667 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -281,7 +281,6 @@ DeviceState *qdev_device_add(QemuOpts *opts)
qerror_report(QERR_DEVICE_INIT_FAILED, driver);
return NULL;
}
- qdev->opts = opts;
return qdev;
}
@@ -410,8 +409,6 @@ void qdev_free(DeviceState *dev)
vmstate_unregister(dev, dev->info->vmsd, dev);
if (dev->info->exit)
dev->info->exit(dev);
- if (dev->opts)
- qemu_opts_del(dev->opts);
}
QLIST_REMOVE(dev, sibling);
g_free(dev->id);
@@ -921,6 +918,8 @@ int do_device_add(Monitor *mon, const QDict *qdict, QObject
**ret_data)
qemu_opts_del(opts);
return -1;
}
+ qemu_opts_del(opts);
+
return 0;
}
diff --git a/hw/qdev.h b/hw/qdev.h
index c86736a..d15a47e 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -32,7 +32,6 @@ enum {
struct DeviceState {
char *id;
enum DevState state;
- QemuOpts *opts;
int hotplugged;
DeviceInfo *info;
BusState *parent_bus;
--
1.7.4.1
- [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 05/14] qdev: remove opts pointer tracking,
Anthony Liguori <=
- [Qemu-devel] [PATCH 01/14] apic: rename apic.id -> apic.index, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 13/14] ide: give IDE drives a default name in qdev, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 12/14] pci: give pci devices a default name., Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 09/14] fw_cfg: add name to global fw_cfg device, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 03/14] qdev: push id into qdev_create calls, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 02/14] qdev: enforce that no devices overload the id property, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 08/14] sysbus: make create_varargs take an id, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 14/14] pc: assign names to machine created devices, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 04/14] qdev: take ownership of id pointer, Anthony Liguori, 2011/09/16