qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 3/4] qdev-monitor: set DeviceState opts before callin


From: Alex Williamson
Subject: [Qemu-devel] [PULL 3/4] qdev-monitor: set DeviceState opts before calling realize
Date: Wed, 26 Feb 2014 11:26:06 -0700
User-agent: StGit/0.17-dirty

From: Bandan Das <address@hidden>

Setting opts before the realize property is set allows the
following patch to make decisions based on whether the user
specified "rombar". This also avoids having to create a new
tristate property especially for this purpose

Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Bandan Das <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>
---
 qdev-monitor.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 3a7dc0d..6673e3c 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -548,16 +548,18 @@ DeviceState *qdev_device_add(QemuOpts *opts)
                                   OBJECT(dev), NULL);
         g_free(name);
     }
+
+    dev->opts = opts;
     object_property_set_bool(OBJECT(dev), true, "realized", &err);
     if (err != NULL) {
         qerror_report_err(err);
         error_free(err);
+        dev->opts = NULL;
         object_unparent(OBJECT(dev));
         object_unref(OBJECT(dev));
         qerror_report(QERR_DEVICE_INIT_FAILED, driver);
         return NULL;
     }
-    dev->opts = opts;
     return dev;
 }
 




reply via email to

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