]> git.ipfire.org Git - thirdparty/libvirt.git/commit
testutilsqemu: Write getter/setter for CPU def global variables
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 5 May 2022 14:27:55 +0000 (16:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 6 May 2022 10:19:34 +0000 (12:19 +0200)
commit776e9a6b26c0b6018b50d5ffba6e8af7a43d7648
tree7f352d746f47e8fe76868df4ee61edb3a23bedf5
parentdff4b21585bb7ccc7954329bc58b57ed98c62829
testutilsqemu: Write getter/setter for CPU def global variables

As of 47503cc859 we are statically linking libtest_utils_qemu.a
into qemuhotplugmock.so (see the original commit for reasoning).
However, this breaks ASAN on older clang because now
qemuhotplugtest has two instances of virCPUDef global variables
(cpuDefault, cpuHaswell, cpuPower8, cpuPower9). One that comes
from the binary itself (which also links with
libtest_utils_qemu.a) and the other from the mock. Resolve this
by making the variables static and introducing getter and setter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tests/qemuxml2argvtest.c
tests/testutilsqemu.c
tests/testutilsqemu.h