Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/cpu/cpu_arm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index c9114d53bf..51a3c1f3ee 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -150,6 +150,25 @@ virCPUarmDataIsIdentical(const virCPUData *a, return VIR_CPU_COMPARE_IDENTICAL; } +static virCPUData * +virCPUarmDataCopyNew(virCPUData *data) +{ + virCPUData *copy; + size_t i; + + if (!data) + return NULL; + + copy = virCPUDataNew(data->arch); + copy->data.arm.pvr = data->data.arm.pvr; + copy->data.arm.vendor_id = data->data.arm.vendor_id; + copy->data.arm.features = g_new0(char *, MAX_CPU_FLAGS + 1); + for (i = 0; i < MAX_CPU_FLAGS; ++i) + copy->data.arm.features[i] = g_strdup(data->data.arm.features[i]); + + return copy; +} + static void virCPUarmDataFree(virCPUData *cpuData) { @@ -696,6 +715,7 @@ struct cpuArchDriver cpuDriverArm = { #endif .decode = NULL, .encode = NULL, + .dataCopyNew = virCPUarmDataCopyNew, .dataFree = virCPUarmDataFree, .baseline = virCPUarmBaseline, .update = virCPUarmUpdate, -- 2.31.1