• Dimitris Aragiorgis's avatar
    utils: Introduce GetFreeSlot() function · a813462d
    Dimitris Aragiorgis authored
    Since this is a generic function that implements bitarray logic move
    it from kvm to utils so that it can be easily used across all modules.
    Make it raise errors.GenericError if it cannot find a free slot in
    the given bitarray.
    We add this function in a separate utils module (bitarrays) that can be
    extended in the future. Currently only the network module and the
    KVM hypervisor make use of bitarrays. This patch is a step forward
    unifying these pieces of code and make both use the same bitarray
    utility functions.
    Add unittest for bitarrays utils module.
    Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
    Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
bitarrays.py 2.36 KB