On Wed, Nov 21, 2018 at 03:11:59PM +0000, Paul Durrant wrote: > The legacy PV backend infrastructure provides functions to map, unmap and > copy pages granted by frontends. Similar functionality will be required > by XenDevice implementations so this patch adds the necessary support. > > Signed-off-by: Paul Durrant <paul.durr...@citrix.com> > --- > +typedef struct XenDeviceGrantCopySegment { > + union { > + void *virt; > + struct { > + uint32_t ref; > + off_t offset; > + } foreign; > + } source, dest;
Why is there a union between `source` and `dest`, I don't see any way (another field) to distinguish which is which. Can't we have a segment without `source`/`dest`? It mimic the xengnttab_grant_copy_segment_t but that doesn't seems very useful as it doesn't really prevent mistake. > + size_t len; > +} XenDeviceGrantCopySegment; Anyway, it's not very important: Reviewed-by: Anthony PERARD <anthony.per...@citrix.com> Thanks, -- Anthony PERARD