mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 08:35:22 +00:00
66ec11ade4
The s390, ppc and arm CPU drivers never set the 'arch' field in their impl of cpuArchNodeData. This leads to error messages being reported from cpuDataFree later, due to trying to use VIR_ARCH_NONE. #0 virRaiseErrorFull (filename=filename@entry=0x76f94434 "cpu/cpu.c", funcname=funcname@entry=0x76f942dc <__FUNCTION__.18096> "cpuGetSubDriver", linenr=linenr@entry=58, domain=domain@entry=31, code=code@entry=1, level=level@entry=VIR_ERR_ERROR, str1=0x76f70e18 "internal error: %s", str2=str2@entry=0x7155f2ec "undefined hardware architecture", str3=str3@entry=0x0, int1=int1@entry=-1, int2=int2@entry=-1, fmt=0x76f70e18 "internal error: %s") at util/virerror.c:646 #1 0x76e682ea in virReportErrorHelper (domcode=domcode@entry=31, errorcode=errorcode@entry=1, filename=0x76f94434 "cpu/cpu.c", funcname=0x76f942dc <__FUNCTION__.18096> "cpuGetSubDriver", linenr=linenr@entry=58, fmt=0x76f7e7e4 "%s") at util/virerror.c:1292 #2 0x76ed82d4 in cpuGetSubDriver (arch=<optimized out>) at cpu/cpu.c:57 #3 cpuGetSubDriver (arch=VIR_ARCH_NONE) at cpu/cpu.c:51 #4 0x76ed8818 in cpuDataFree (data=data@entry=0x70c22d78) at cpu/cpu.c:216 #5 0x716aaec0 in virQEMUCapsInitCPU (arch=VIR_ARCH_ARMV7L, caps=0x70c29a08) at qemu/qemu_capabilities.c:867 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
80 lines
1.9 KiB
C
80 lines
1.9 KiB
C
/*
|
|
* cpu_arm.c: CPU driver for arm CPUs
|
|
*
|
|
* Copyright (C) Canonical Ltd. 2012
|
|
*
|
|
* 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/>.
|
|
*
|
|
* Authors:
|
|
* Chuck Short <chuck.short@canonical.com>
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "viralloc.h"
|
|
#include "cpu.h"
|
|
|
|
#define VIR_FROM_THIS VIR_FROM_CPU
|
|
|
|
static const virArch archs[] = { VIR_ARCH_ARMV7L };
|
|
|
|
static virCPUDataPtr
|
|
ArmNodeData(virArch arch)
|
|
{
|
|
virCPUDataPtr data;
|
|
|
|
if (VIR_ALLOC(data) < 0)
|
|
return NULL;
|
|
|
|
data->arch = arch;
|
|
|
|
return data;
|
|
}
|
|
|
|
static int
|
|
ArmDecode(virCPUDefPtr cpu ATTRIBUTE_UNUSED,
|
|
const virCPUDataPtr data ATTRIBUTE_UNUSED,
|
|
const char **models ATTRIBUTE_UNUSED,
|
|
unsigned int nmodels ATTRIBUTE_UNUSED,
|
|
const char *preferred ATTRIBUTE_UNUSED,
|
|
unsigned int flags)
|
|
{
|
|
|
|
virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static void
|
|
ArmDataFree(virCPUDataPtr data)
|
|
{
|
|
VIR_FREE(data);
|
|
}
|
|
|
|
struct cpuArchDriver cpuDriverArm = {
|
|
.name = "arm",
|
|
.arch = archs,
|
|
.narch = ARRAY_CARDINALITY(archs),
|
|
.compare = NULL,
|
|
.decode = ArmDecode,
|
|
.encode = NULL,
|
|
.free = ArmDataFree,
|
|
.nodeData = ArmNodeData,
|
|
.guestData = NULL,
|
|
.baseline = NULL,
|
|
.update = NULL,
|
|
.hasFeature = NULL,
|
|
};
|