From: Roman Bolshakov Date: Mon, 23 Nov 2020 22:10:18 +0000 (+0300) Subject: qemucapsprobemock: Fix lookup of qemu functions X-Git-Tag: v6.10.0-rc2^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78999beabc16c6ad3ee0838cf7d9d4c95d717b83;p=thirdparty%2Flibvirt.git qemucapsprobemock: Fix lookup of qemu functions qemucapsprobemock can't find real versions of qemuMonitorSend() and qemuMonitorJSONIOProcessLine() on macOS. That breaks qemucapsprobe. The failure can be explained by documented behaviour of dlsym(3) on macOS: If dlsym() is called with the special handle RTLD_NEXT, then dyld searches for the symbol in the dylibs the calling image linked against when built. [...] For flat linked images, the search starts in the load ordered list of all images, in the image right after the caller's image. That means qemucapsprobemock must be linked against qemu test driver to find symbols there with RTLD_NEXT. Signed-off-by: Roman Bolshakov Reviewed-by: Michal Privoznik --- diff --git a/tests/meson.build b/tests/meson.build index e2682cb3a5..f1d91ca50d 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -101,7 +101,6 @@ endif if conf.has('WITH_QEMU') mock_libs += [ { 'name': 'qemucaps2xmlmock' }, - { 'name': 'qemucapsprobemock' }, { 'name': 'qemucpumock' }, { 'name': 'qemuhotplugmock' }, { 'name': 'qemuxml2argvmock' }, @@ -171,6 +170,10 @@ if conf.has('WITH_QEMU') link_whole: [ qemu_driver_impl ], link_with: [ libvirt_lib ], ) + + mock_libs += [ + { 'name': 'qemucapsprobemock', 'link_with': [ test_qemu_driver_lib ] }, + ] else test_qemu_driver_lib = [] test_utils_qemu_lib = []