On Tue, Aug 19, 2014 at 7:41 PM, <arei.gong...@huawei.com> wrote: > From: Gonglei <arei.gong...@huawei.com> > > If local_err is not null, the next code logic is useless. > > Signed-off-by: Gonglei <arei.gong...@huawei.com> > --- > hw/core/qdev.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > index da1ba48..3e7085e 100644 > --- a/hw/core/qdev.c > +++ b/hw/core/qdev.c > @@ -830,6 +830,11 @@ static void device_set_realized(Object *obj, bool value, > Error **errp) > g_free(name); > } > > + if (local_err != NULL) { > + error_propagate(errp, local_err); > + return; > + } > +
So I'm curious to know if and how this manifested for you as a bug? Can you reproduce this as a bug somehow even as a memory leak? as the only way I can see local_err getting populated is a fail of: object_property_add_child(container_get(qdev_get_machine(), "/unattached"), name, obj, &local_err); Which, if fails indicates something very wrong. Should we promote that fail to &error_abort and just drop the local_err logic entirely? I'm very interested on your replication conditions on this one. Regards, Peter > if (dc->realize) { > dc->realize(dev, &local_err); > } > -- > 1.7.12.4 > > >