qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 06/22] char: add a /chardevs container


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH 06/22] char: add a /chardevs container
Date: Tue, 7 Feb 2017 15:03:55 -0500 (EST)

Hi

----- Original Message -----
> 
> 
> On 02/02/2017 15:51, Marc-André Lureau wrote:
> > +    if (QTAILQ_IN_USE(chr, next)) {
> > +        QTAILQ_REMOVE(&chardevs, chr, next);
> > +    }
> > +    if (OBJECT(chr)->parent) {
> > +        object_unparent(OBJECT(chr));
> > +    } else {
> > +        object_unref(OBJECT(chr));
> > +    }
> 
> What's the case where the "else" is used?  Probably qemu_chr_delete
> callers should be changed to use object_unparent or object_unref directly.

I thought about that, but calling object_unparent() seems weird, since callers 
aren't much aware of the fact that chardev are added or not to a container 
(useless distinction imho). I wish the last object_unref() would automatically 
unparent, if the object has a parent. Would that be acceptable?



reply via email to

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