test: Link qemuhotplugmock with test_utils_qemu and test_utils

As of ad81aa8ad0 the qemuhotplugmock.c calls
testQemuPrepareHostBackendChardevOne() which is implemented in
testutilsqemu.c. However, the mock is not linked with
testutilsqemu static library which makes some tools (valgrind
particularly) unhappy because the resulting mock library has
unresolved symbol.

The fix is simple, link mock library with test_utils_qemu_lib and
also with test_utils_lib since testutils.c calls some functions
from testutils.c.

Since these two libraries are declared only after mock_libs[], I
had to move the line that declares qemuhotplugmock after those
two.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-04-04 12:22:37 +02:00
parent b399f2c000
commit 47503cc859

View File

@ -122,7 +122,6 @@ if conf.has('WITH_QEMU')
mock_libs += [
{ 'name': 'qemucaps2xmlmock' },
{ 'name': 'qemucpumock' },
{ 'name': 'qemuhotplugmock' },
{ 'name': 'qemuxml2argvmock' },
{ 'name': 'virhostidmock' },
]
@ -193,6 +192,7 @@ if conf.has('WITH_QEMU')
mock_libs += [
{ 'name': 'qemucapsprobemock', 'link_with': [ test_qemu_driver_lib ] },
{ 'name': 'qemuhotplugmock', 'link_with': [ test_utils_qemu_lib, test_utils_lib ] },
]
else
test_qemu_driver_lib = []