qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] DO_UPCAST confusion


From: Peter Maydell
Subject: Re: [Qemu-devel] DO_UPCAST confusion
Date: Thu, 22 Oct 2015 10:58:09 +0100

On 21 October 2015 at 23:49, Eric Blake <address@hidden> wrote:
> I much prefer the name container_of() (which is a bit more obvious that
> it is finding the container or derived type that embeds the parent
> type), but if we have to keep the ugly name, could we at least clean up
> the comment to make sense, and fix the name to be DO_DOWNCAST to match
> what it is actually doing?

You can't call this one container_of, because it's doing
container_of plus extra checking.

As Gerd says, most of these uses should probably go away, but
ideally by conversion to the QOM cast macros rather than
just dropping down to use of container_of.

thanks
-- PMM



reply via email to

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