On 28/07/20 09:44, Markus Armbruster wrote: >> - assert(!DEVICE_GET_CLASS(dev)->bus_type); >> + } else if (DEVICE_GET_CLASS(dev)->bus_type) { >> + error_setg(errp, "Unexpected bus '%s' for bus-less device '%s'", >> + DEVICE_GET_CLASS(dev)->bus_type, >> + object_get_typename(OBJECT(dev))); >> + return false; >> } >> >> object_property_set_bool(OBJECT(dev), true, "realized", &err); > Objection. This turns an abort into something else unless the caller > passes &error_abort. The caller in your commit message's example does, > others don't. > > Keep the unconditional abort, please. Feel free to print something kind > right before. I doubt it's all that useful, as I believe whoever gets > to fix the bug will have to figure out the code anyway, but I could be > wrong. >
This was my request, actually. We have an Error**, we should use it in case this code is reached via device_add. Paolo