qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] qdev: add missing error check


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] [PATCH 1/3] qdev: add missing error check
Date: Wed, 20 Aug 2014 02:27:06 +0000

> > If local_err is not null, the next code logic is useless.
> >
> > Signed-off-by: Gonglei <address@hidden>
> > ---
> >  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.
> 
Actually I just read code and find the problem. I can't agree more with you. 
Thanks, Peter!

Best regards,
-Gonglei

reply via email to

[Prev in Thread] Current Thread [Next in Thread]