[libvirt] [PATCH] tests: link virpcimock with utils

Michal Privoznik mprivozn at redhat.com
Mon Apr 10 11:00:58 UTC 2017


On 04/10/2017 09:52 AM, Pavel Hrdina wrote:
> In virpcimock we use some functions from utils so we should link
> utils library to provide required symbols.
>
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  tests/Makefile.am | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 279e9b7da8..8b9bba31ce 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -1131,7 +1131,8 @@ virpcimock_la_SOURCES = \
>  	virpcimock.c
>  virpcimock_la_CFLAGS = $(AM_CFLAGS)
>  virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
> -virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
> +virpcimock_la_LIBADD = $(MOCKLIBS_LIBS) \
> +	../src/libvirt_util.la

You forgot to include $(PROBES_O). But even with that added in, this 
will not fly. While you make it work under libvirt it fails without it 
because 'stat' is undefined but called. Look into virtestmock.c for 
explanation.

I'm not sure how to address this issue. I know about it for quite some 
time now but all my previous attempts to fix it (including this one) 
failed. I've tried to mimic what virtestmock.c does, but without any luck.

Michal




More information about the libvir-list mailing list