On 04/22/2016 11:42 AM, Kevin Wolf wrote: > Some features, like I/O throttling, are implemented outside > block-backend.c, but still want to keep information in BlockBackend, > e.g. list entries that allow keeping a list of BlockBackends. > > In order to avoid exposing the whole struct layout in the public header > file, this patch introduces an embedded public struct where such > information can be added and a pair of functions to convert between > BlockBackend and BlockBackendPublic. > > Signed-off-by: Kevin Wolf <[email protected]> > ---
> +/* This struct is embedded in (the private) BlockBackend struct and contains
> + * fields that must be public. This is in particular for QLIST_ENTRY() and
> + * friends so that BlockBackends can be kept in lists outside
> block-backend.c */
> +typedef struct BlockBackendPublic {
> + int dummy; /* empty structs are illegal */
Nit - it's not breaking any laws, so s/illegal/invalid/ sounds slightly
better. But not enough to stop me from reviewing.
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
