aboutsummaryrefslogtreecommitdiff
path: root/qdev-monitor.c
diff options
context:
space:
mode:
authorBandan Das <bsd@redhat.com>2014-02-26 10:32:40 -0700
committerAlex Williamson <alex.williamson@redhat.com>2014-02-26 10:32:40 -0700
commit52aa17cbd800b9e71b67cf7f80c3498183d34ec8 (patch)
tree045ed30fb5ad3771a8c14be849aa23bbc15a74f0 /qdev-monitor.c
parent82d07945652f16078b172d2bd46659e8f5f30d8e (diff)
qdev-monitor: set DeviceState opts before calling realize
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 <afaerber@suse.de> Signed-off-by: Bandan Das <bsd@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'qdev-monitor.c')
-rw-r--r--qdev-monitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 3a7dc0d428..6673e3cb61 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;
}