[libvirt] [PATCH 3/3] qemuxml2argvmock: Mock virNumaNodesetIsAvailable

Martin Kletzander mkletzan at redhat.com
Thu Nov 6 07:16:51 UTC 2014


On Wed, Nov 05, 2014 at 06:07:18PM +0100, Michal Privoznik wrote:
>And yet again one fix of 90286418. The problem is, if libvirt is
>built with NUMA disabled (--without-numad --without-numactl), the
>testsuite doesn't count on that and some tests fail. This is
>because the virNumaNodesetIsAvailable() function is taken from
>another section of virnuma.c which contains functions stubs for
>case NUMA is disabled at build time. And the function basically
>yields an error. However, we want our testsuite to be
>deterministic and hence we ought to mock the function.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tests/qemuxml2argvmock.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
>diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
>index 7218747..7b8bdd6 100644
>--- a/tests/qemuxml2argvmock.c
>+++ b/tests/qemuxml2argvmock.c
>@@ -39,3 +39,12 @@ virNumaGetMaxNode(void)
>
>    return maxnodesNum;
> }
>+
>+bool
>+virNumaNodesetIsAvailable(virDomainNumatunePtr numatune)
>+{
>+    int maxGuestNode = virDomainNumatuneSpecifiedMaxNode(numatune);
>+    int maxHostNode = virNumaGetMaxNode();
>+
>+    return maxGuestNode <= maxHostNode;
>+}
>--
>2.0.4
>

NACK, we shouldn't need to mock this function.  I went over the commit
once more and I've realized it doesn't support non-contiguous nodesets
even if it could.  And since it will use only functions that have both
versions (better one with NUMA support and a stub without it) it can
be moved out of those #ifdefs.  I have the patch almost ready :)

I'll also remove the need for util to have connection to conf (it will
make more sense, hopefully.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141106/5c8f734f/attachment-0001.sig>


More information about the libvir-list mailing list