Message ID | 1393302864-11348-2-git-send-email-bsd@redhat.com |
---|---|
State | New |
Headers | show |
Am 25.02.2014 05:34, schrieb Bandan Das: > 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 > > Signed-off-by: Bandan Das <bsd@redhat.com> > --- > qdev-monitor.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Makes perfect sense, Reviewed-by: Andreas Färber <afaerber@suse.de> Queuing a copy on qom-next to avoid conflicts with a v2 for Amos' link<> issue. Thanks, Andreas
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; }
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 Signed-off-by: Bandan Das <bsd@redhat.com> --- qdev-monitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)