'Check that the host_state provided satisfies any available
CPU policy requirements.'

def _satisfies_cpu_policy(self, host_state, extra_specs, image_props):

    (host_topology, _) = hardware.host_topology_and_format_from_host(host_state)
    cpu_policy = [extra_specs.get('hw:cpu_policy'), image_props.get('hw_cpu_policy')]
    cpu_thread_policy = [extra_specs.get('hw:cpu_thread_policy'), image_props.get('hw_cpu_thread_policy')]
    if (not host_topology):
        return True
    if (fields.CPUAllocationPolicy.DEDICATED not in cpu_policy):
        return True
    if (fields.CPUThreadAllocationPolicy.REQUIRE not in cpu_thread_policy):
        return True
    has_hyperthreading = any((cell.siblings for cell in host_topology.cells))
    if (not has_hyperthreading):
        LOG.debug("%(host_state)s    fails    CPU    policy    requirements.    Host    does    not    have    hyperthreading    or    hyperthreading    is    disabled,    but    'require'    threads    policy    was    requested.", {'host_state': host_state})
        return False
    return True
