diff options
author | CrÃstian Viana <vianac@linux.vnet.ibm.com> | 2012-05-30 00:35:51 -0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-19 13:36:56 -0500 |
commit | 93bfef4c6e4b23caea9d51e1099d06433d8835a4 (patch) | |
tree | 89ede1eb2d2c290b991c7e54068ca8f37d594bbd /target-i386/cpu.c | |
parent | 459ae5ea5ad682c2b3220beb244d4102c1a4e332 (diff) |
Allow machines to configure the QEMU_VERSION that's exposed via hardware
QEMU exposes its version to the guest's hardware and in some cases that is wrong
(e.g. Windows prints messages about driver updates when you switch
the QEMU version).
There is a new field now on the struct QEmuMachine, hw_version, which may
contain the version that the specific machine should report. If that field is
set, then that machine will report that version to the guest.
Signed-off-by: CrÃstian Viana <vianac@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r-- | target-i386/cpu.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 0b6116246f..fdd95be8cf 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -305,7 +305,6 @@ static x86_def_t builtin_x86_defs[] = { .ext3_features = CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A, .xlevel = 0x8000000A, - .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, { .name = "phenom", @@ -388,7 +387,6 @@ static x86_def_t builtin_x86_defs[] = { .features = PPRO_FEATURES, .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_POPCNT, .xlevel = 0x80000004, - .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, { .name = "kvm32", @@ -467,8 +465,6 @@ static x86_def_t builtin_x86_defs[] = { .features = PPRO_FEATURES | CPUID_PSE36 | CPUID_VME | CPUID_MTRR | CPUID_MCA, .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_MMXEXT | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT, .xlevel = 0x80000008, - /* XXX: put another string ? */ - .model_id = "QEMU Virtual CPU version " QEMU_VERSION, }, { .name = "n270", @@ -1299,11 +1295,23 @@ void cpu_clear_apic_feature(CPUX86State *env) */ void x86_cpudef_setup(void) { - int i; + int i, j; + static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" }; for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) { builtin_x86_defs[i].next = x86_defs; builtin_x86_defs[i].flags = 1; + + /* Look for specific "cpudef" models that */ + /* have the QEmu version in .model_id */ + for (j = 0; j < ARRAY_SIZE(model_with_versions); j++) { + if (strcmp(model_with_versions[j], builtin_x86_defs[i].name) == 0) { + pstrcpy(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), "QEMU Virtual CPU version "); + pstrcat(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), qemu_get_version()); + break; + } + } + x86_defs = &builtin_x86_defs[i]; } #if !defined(CONFIG_USER_ONLY) |