[Spice-devel] [PATCH spice-protocol] stats: Avoid holes in SpiceStat structure
Frediano Ziglio
fziglio at redhat.com
Thu Jan 3 16:41:48 UTC 2019
> On Thu, Jan 03, 2019 at 10:15:43AM -0500, Frediano Ziglio wrote:
> > >
> > > On Thu, Jan 03, 2019 at 02:14:24PM +0000, Frediano Ziglio wrote:
> > > > The SpiceStat structure can be 20 or 24 bytes depending on alignment.
> > > > Being a memory mapped structure potentially used with lockless access
> > > > is not good to have it unaligned.
> > > > The current tool that reads this memory mapped file (reds_stats) is
> > > > able to detect if the structure is either 20 or 24 bytes and act
> > > > according so changing this structure won't affect the behaviour
> > > > (unless you have an old tool but as they are usually packages together
> > > > is quite improbable).
>
> spice/stats.h is however a public header shipped by the spice-protocol
> package, we cannot really assume that the only user of the SpiceStat
> structure is reds_stats.
>
> Christophe
>
I did some search but I didn't find any usage of this beside us and reds_stat.
Note that the structure will change layout only on 32-bit which is not
that recommended nowadays (64 bit platforms we support align 64 bit integer
to 64 bit).
Maybe I should add last sentence to commit message, I'll do it.
Frediano
More information about the Spice-devel
mailing list