]> xenbits.xensource.com Git - libvirt.git/commit
host-validate: Improve CPU flags processing
authorAndrea Bolognani <abologna@redhat.com>
Tue, 29 Mar 2016 14:38:28 +0000 (16:38 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 7 Apr 2016 15:31:41 +0000 (17:31 +0200)
commitc661b675f12c7e092873cb2078ab07e6dbce7a31
tree8d5e5447c6f31fb7c85a3ab03b8d69d46802547a
parent032c5bf988ddd6dc3bbd07692c3def1afb36a461
host-validate: Improve CPU flags processing

Instead of relying on substring search, tokenize the input
and process each CPU flag separately. This ensures CPU flag
detection will continue to work correctly even if we start
looking for CPU flags whose name might appear as part of
other CPU flags' names.

The result of processing is stored in a virBitmap, which
means we don't have to parse /proc/cpuinfo in its entirety
for each single CPU flag we want to check.

Moreover, use of the newly-introduced virHostValidateCPUFlag
enumeration ensures we don't go looking for random CPU flags
which might actually be simple typos.
tools/virt-host-validate-common.c
tools/virt-host-validate-common.h
tools/virt-host-validate-qemu.c