qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]