]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: macmap: Convert to use GSList for storing macs instead of string lists
authorPeter Krempa <pkrempa@redhat.com>
Fri, 5 Feb 2021 13:25:16 +0000 (14:25 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 11 Feb 2021 16:05:33 +0000 (17:05 +0100)
commit00dfd9c97d218330686698e88a45d20035afdf99
treea3bef4ff105b8db0baec13eae9cda50c64ee7792
parent4ebc27865737e8bcda007a2e93c99f892c2b268b
util: macmap: Convert to use GSList for storing macs instead of string lists

Since adding and removing is the main use case for the macmap module,
convert the code to a more efficient data structure.

The refactor also optimizes the loading from file where previously we'd
do a hash lookup + list lenght calculation for every entry.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virmacmap.c
src/util/virmacmap.h
tests/virmacmaptest.c