]> xenbits.xensource.com Git - libvirt.git/commit
virsysinfo: Calculate OEM string index better
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2024 13:09:22 +0000 (15:09 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Jul 2024 14:51:17 +0000 (16:51 +0200)
commitbd11c753f3f947d91ae0c8d2ba965e5661e25080
tree0a9c8a8266995613eb83e87d73a7188a7edb7bbd
parent5bb4540dbbb5bf85121dee4dfd9e1b982bcac953
virsysinfo: Calculate OEM string index better

As can be seen in earlier commits, there can be two OEM strings
with the same index. But since our parser
(virSysinfoParseOEMStrings()) doesn't expect that, it increments
index in each run and thus skips over these strings.
Fortunately, we have the right index at hand - we're just
skipping over it in a loop. Just reconstruct the index back
inside the loop.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/util/virsysinfo.c
tests/sysinfodata/aarch64-hpe-apollosysinfo.expect
tests/sysinfotest.c