qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 08/13] block: Introduce BdrvChild.opaque


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 08/13] block: Introduce BdrvChild.opaque
Date: Fri, 6 May 2016 15:19:05 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 06.05.2016 um 14:54 hat Alberto Garcia geschrieben:
> On Fri 22 Apr 2016 07:42:37 PM CEST, Kevin Wolf wrote:
> > BlockBackends use it to get a back pointer from BdrvChild to
> > BlockBackend in any BdrvChildRole callbacks.
> 
> Hmmm... can anyone else use this, other than BlockBackend? If not, why
> is it opaque?

If we ever want to call BdrvChild callbacks from somewhere else than the
top of the image, there will be others users of this. For example, I
could imagine .resize() or .change_media() to propagate through the
whole tree when the host_cdrom driver detected a media change.

At the moment we probably don't have another use for it, but it's the
usual style that callbacks get an opaque value, so I just followed the
pattern here. (And I don't want people to abuse this to get back from
BDS to BB outside of such callbacks.)

Kevin



reply via email to

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