[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 1/2] Interface for grant copy operation in libs.
On Wed, Jun 22, 2016 at 3:52 PM, Wei Liu <wei.liu2@xxxxxxxxxx> wrote: >> I think the best solution is to allow the osdep code to provide the >> implementation of xengnttab_grant_copy_segment_t, allowing the Linux >> code to do: >> >> typedef ioctl_gntdev_grant_copy_segment xengnttab_grant_copy_segment_t >> >> You should still provide the generic structure as well, for those >> platforms that don't provide their own optimized version. >> > > We can't do that (yet). This means we open the door for divergence on > different platforms. > > Basically this approach requires each platform to do the same thing > (typedef) This implies any application that uses libxengnttab will need > to test what platform it runs on. It is just pushing the issue somewhere > else. > > Still, I think I would wait a bit for other people to weight in because > I'm not sure if my concern is wrong headed. I tend to be sympathetic to David's argument here. The library has to provide some ABI to callers; and it has to know the appropriate Linux ABI in order to translate from the library ABI to the Linux ABI. If it happens to know these are the same, I don't see a reason not to "translate" it by just by casting the pointer. If we want to declare the library ABI in a stand-alone fashion (i.e., instead of just doing a typedef, so that the library definition is the same on all platforms), then having some compile-time checking to make sure that the layouts of the two structures are identical makes sense. Beyond that, I'm not sure what the extra copying really buys us. -George _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |