runtime-spec icon indicating copy to clipboard operation
runtime-spec copied to clipboard

major and minor type issue

Open Mashimiao opened this issue 9 years ago • 1 comments
trafficstars

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?

Mashimiao avatar Aug 30 '16 02:08 Mashimiao

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 in DeviceCgroup. 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.

wking avatar Aug 30 '16 03:08 wking