diff --git a/scripts/check-aclrules.py b/scripts/check-aclrules.py index 2335e8cfdd..ed6805058b 100755 --- a/scripts/check-aclrules.py +++ b/scripts/check-aclrules.py @@ -62,6 +62,14 @@ implpermitted = { "vzDomainMigrateConfirm3Params": True, } +aclFuncHelpers = { + "virDomainDriverNodeDeviceDetachFlags": True, + "virDomainDriverNodeDeviceReset": True, + "virDomainDriverNodeDeviceReAttach": True, +} + +aclFuncHelperFile = "domain_driver.c" + lastfile = None @@ -136,8 +144,14 @@ def process_file(filename): maybefunc = None intable = False table = None + aclHelperFileCheck = False + + acls = aclFuncHelpers + + if aclFuncHelperFile in filename: + acls = {} + aclHelperFileCheck = True - acls = {} aclfilters = {} errs = False with open(filename, "r") as fh: @@ -262,6 +276,15 @@ def process_file(filename): if "}" in line: brace = brace - 1 + if aclHelperFileCheck: + for helper in aclFuncHelpers: + if helper not in acls: + print(("%s:%d Missing ACL check in helper function '%s'") % + (filename, lineno, helper), + file=sys.stderr) + + errs = True + return errs diff --git a/src/hypervisor/meson.build b/src/hypervisor/meson.build index 32d5ab365f..70801c0820 100644 --- a/src/hypervisor/meson.build +++ b/src/hypervisor/meson.build @@ -5,6 +5,8 @@ hypervisor_sources = [ 'virhostdev.c', ] +stateful_driver_source_files += files(hypervisor_sources) + hypervisor_lib = static_library( 'virt_hypervisor', [