libvirt/tests/nodeinfomock.c
Shivaprasad G Bhat 3020f550ca tests: Prepare for subcore tests
The nodeGetThreadsPerSubcore() function is mocked to return 8 for
ppc64 tests, which corresponds to the default subcore mode.

Update the expected output for the deconfigured-cpus nodeinfo
test to account for this change.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2015-08-03 08:38:46 -04:00

36 lines
1003 B
C

/*
* Copyright (C) 2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include <config.h>
#include "internal.h"
#include "nodeinfo.h"
int
nodeGetThreadsPerSubcore(virArch arch)
{
int threads_per_subcore = 0;
// Emulate SMT=8 on POWER hardware
if (ARCH_IS_PPC64(arch))
threads_per_subcore = 8;
return threads_per_subcore;
}