• D
    conf: rewrite filtering for capabilities lookup · 68dc579f
    Daniel P. Berrangé 提交于
    The virCapabilitiesDomainDataLookupInternal() is given a list of
    parameters representing the desired domain characteristics. It then has
    to look throught the capabilities to identify an acceptable match.
    
    The virCapsDomainDataCompare() method is used for filtering out
    candidates which don't match the desired criteria. It is called
    primarily from the innermost loops and as such is doing many repeated
    checks. For example if architcture and os type were checked at the top
    level loop the two inner loops could be avoided entirely. If emulator
    and domain type were checked in the 2nd level loop the 3rd level loop
    can be avoided too.
    
    This change thus removes the virCapsDomainDataCompare() method and puts
    suitable checks at the start of each loop to ensure it executes the
    minimal number of loop iterations possible. The code becomes clearer to
    understand as a nice side-effect.
    Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
    68dc579f
capabilities.c 51.2 KB