Il 06/06/2014 09:09, Markus Armbruster ha scritto:
Looks like this regressed in Eduardo's commit 99a0b03 qdev: Set globals
in instance_post_init function.
Before, we exited cleanly on this error, in device_initfn():
qdev_prop_set_globals(dev, &err);
if (err != NULL) {
qerror_report_err(err);
error_free(err);
exit(1);
}
Hmm, right. I had noticed this abort in the past, but I wasn't sure if
it was a regression or not.
However, the above is not hotplug-friendly either. In this sense, I
prefer an assertion that clearly says "gotta fix something here".
The commit asserts qdev_prop_set_globals() can't fail, which is wrong.
static void device_post_init(Object *obj)
{
DeviceState *dev = DEVICE(obj);
Error *err = NULL;
qdev_prop_set_globals(dev, &err);
assert_no_error(err);
}
Later simplified to:
static void device_post_init(Object *obj)
{
qdev_prop_set_globals(DEVICE(obj), &error_abort);
}
I think the bug is that the global property should have been filtered
out early. Or alternatively we need something better than
device_post_init to set the globals... no ideas for now.
Paolo