On Tue, Feb 05, 2013 at 05:47:16PM -0600, Jesse Larrew wrote: > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index f1c2884..8f521b3 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -73,8 +73,31 @@ typedef struct VirtIONet > int multiqueue; > uint16_t max_queues; > uint16_t curr_queues; > + int config_size;
size_t > } VirtIONet; > > +/* > + * Calculate the number of bytes up to and including the given 'field' of > + * 'container'. > + */ > +#define endof(container, field) \ > + ((intptr_t)(&(((container *)0)->field)+1)) This isn't really necessary, just use offsetof() with the next field or sizeof() for the last field. Better to avoid this kind of hackery.