[libvirt] [PATCH] qemuxml2argvtest: uncoditionally mock NUMA routines

Roman Bogorodskiy bogorodskiy at gmail.com
Fri May 13 17:53:08 UTC 2016

  Ján Tomko wrote:

> On Thu, May 12, 2016 at 10:47:04AM +0300, Roman Bogorodskiy wrote:
> > Currently, qemuxml2argvmock.c only mocks virNumaNodeIsAvailable(), and
> > only if libvirt was built with NUMA support. This causes some test
> > failures where NUMA is involved.
> > 
> This is misleading, you are probably compiling with clang, which
> inlines virNumaGetMaxNode, so the mocked version of it is never called.
> With no NUMA support, even libvirtd uses the implementation of
> virNumaNodeIsAvailable based on virNumaGetMaxNode.
> And the mocked virNumaNodesetIsAvailable is functionally identical to
> the implementation in virnuma.c.
> There were two attempts to get around it:
> __attribute__((__noinline__))
> https://www.redhat.com/archives/libvir-list/2015-March/msg00203.html
> and mocking virNumaNodesetIsAvailable by its identical copy:
> https://www.redhat.com/archives/libvir-list/2016-March/msg00515.html
> (mocking virNumaNodeIsAvailable should not be needed).
> All they need is a decision.

It's strange, but neither of these two patches fixes the issue for me.
That's with 3.8.0. It starts working only when I pull in both
virNumaNodeIsAvailable() and virNumaNodesetIsAvailable() into
qemuxml2argvmock.c without the #if WITH_NUMACTL conditional.

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160513/a69f1fa3/attachment-0001.sig>

More information about the libvir-list mailing list