mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
This is not a good idea in general, but we can (and have to) do it in specific cases when a feature has always been part of a CPU model in hypervisor's definition, but we ignored it and did not include the feature in our definition. Blindly adding the features to the CPU map and not adding them to existing CPU models breaks migration between old and new libvirt in both directions. New libvirt would complain the features got unexpectedly enabled (as they were not mentioned in the incoming domain XML) even though they were also enabled on the source and the old libvirt just didn't know about them. On the other hand, old libvirt would refuse to accept incoming migration of a domain started by new libvirt because the domain XML would contain CPU features unknown to the old libvirt. This is exactly what happened when several vmx-* features were added a few releases back. Migration between libvirt releases before and after the addition is now broken. This patch adds support for added these features to existing CPU models by marking them with added='yes'. The features will not be considered part of the CPU model and will be described explicitly via additional <feature/> elements, but the compatibility check will not complain if they are enabled by the hypervisor even though they were not explicitly mentioned in the CPU definition and incoming migration from old libvirt will succeed. To fix outgoing migration to old libvirt, we also need to drop all those features from domain XML unless they were explicitly requested by the user. This will be handled by a later patch. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
54 lines
1.9 KiB
C
54 lines
1.9 KiB
C
/*
|
|
* cpu_x86.h: CPU driver for CPUs with x86 compatible CPUID instruction
|
|
*
|
|
* Copyright (C) 2009 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/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "cpu.h"
|
|
#include "cpu_x86_data.h"
|
|
|
|
extern struct cpuArchDriver cpuDriverX86;
|
|
|
|
void virCPUx86DataAdd(virCPUData *cpuData,
|
|
const virCPUx86DataItem *cpuid);
|
|
|
|
void virCPUx86DataSetSignature(virCPUData *cpuData,
|
|
unsigned int family,
|
|
unsigned int model,
|
|
unsigned int stepping);
|
|
|
|
uint32_t virCPUx86DataGetSignature(virCPUData *cpuData,
|
|
unsigned int *family,
|
|
unsigned int *model,
|
|
unsigned int *stepping);
|
|
|
|
int virCPUx86DataSetVendor(virCPUData *cpuData,
|
|
const char *vendor);
|
|
|
|
bool virCPUx86FeatureFilterSelectMSR(const char *name,
|
|
virCPUFeaturePolicy policy,
|
|
void *opaque);
|
|
|
|
bool virCPUx86FeatureFilterDropMSR(const char *name,
|
|
virCPUFeaturePolicy policy,
|
|
void *opaque);
|
|
|
|
int virCPUx86GetAddedFeatures(const char *modelName,
|
|
const char * const **features);
|