runtime-spec
runtime-spec copied to clipboard
major and minor type issue
In config-linux.md:
type of major and minor is int64 in Device, but it's *int64 in DeviceCgroup.
I think they should be the same. Should they?
On Mon, Aug 29, 2016 at 07:09:30PM -0700, Ma Shimiao wrote:
In config-linux.md: type of major and minor is int64 in
Device, but it's *int64 inDeviceCgroup. I think they should be the same. Should they?
You need the pointer type for DeviceCgroup, because the kernel allows wildcards and null (in the config) maps to ‘*’ (in the kernel API) 1.
Device, on the other hand, wraps mknod. You need actual major/minors in most mknod cases, although you need neither (and it should probably be an error to set them) if ‘type’ is ‘p’ 2.
Because of the ‘p’ case, I think *uint (and I'm ok if folks want to size that, since we only need to go up to a few hundred 3) makes sense for both. But we probably want to handle the mknod wrapper in JSON Schema with a oneOf where one case is for the ‘p’ type and one case is for the other types.