def numa_get_reserved_huge_pages():
 bucket = {}
 if CONF.reserved_huge_pages:
  try:
   bucket = collections.defaultdict(dict)
   for cfg in CONF.reserved_huge_pages:
    try:
     pagesize = int(cfg['size'])
    except ValueError:
     pagesize = (strutils.string_to_bytes(cfg['size'], return_int=True) / units.Ki)
    bucket[int(cfg['node'])][pagesize] = int(cfg['count'])
  except (ValueError, TypeError, KeyError):
   raise exception.InvalidReservedMemoryPagesOption(conf=CONF.reserved_huge_pages)
 return bucket

def numa_get_reserved_huge_pages ( ) : bucket = { } if CONF . reserved_huge_pages : try : bucket = collections . defaultdict ( dict ) for cfg in CONF . reserved_huge_pages : try : pagesize = int ( cfg [ 'size' ] ) except ValueError : pagesize = ( strutils . string_to_bytes ( cfg [ 'size' ] , return_int = True ) / units . Ki ) bucket [ int ( cfg [ 'node' ] ) ] [ pagesize ] = int ( cfg [ 'count' ] ) except ( ValueError , TypeError , KeyError ) : raise exception . InvalidReservedMemoryPagesOption ( conf = CONF . reserved_huge_pages ) return bucket
returns reserved memory pages from host option .