Device rules are stored in BPF map that is a hash type, this function
will create a key based on major and minor id of device.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
virCgroupV2DevicesAvailable;
virCgroupV2DevicesCreateProg;
virCgroupV2DevicesDetectProg;
+virCgroupV2DevicesGetKey;
virCgroupV2DevicesGetPerms;
virCgroupV2DevicesPrepareProg;
virCgroupV2DevicesRemoveProg;
return 0;
}
#endif /* !HAVE_DECL_BPF_CGROUP_DEVICE */
+
+
+uint64_t
+virCgroupV2DevicesGetKey(int major,
+ int minor)
+{
+ return (uint64_t)major << 32 | ((uint64_t)minor & 0x00000000ffffffff);
+}
uint32_t
virCgroupV2DevicesGetPerms(int perms,
char type);
+
+uint64_t
+virCgroupV2DevicesGetKey(int major,
+ int minor);