1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

cpu: Honor vendor_id override in host-model

https://bugzilla.redhat.com/show_bug.cgi?id=858147

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2015-04-30 11:10:16 +02:00
parent a41b1f196c
commit 01ecee247a
4 changed files with 48 additions and 0 deletions

View File

@ -2107,6 +2107,12 @@ x86UpdateHostModel(virCPUDefPtr guest,
if (virCPUDefCopyModel(guest, host, true) < 0)
goto cleanup;
if (oldguest->vendor_id) {
VIR_FREE(guest->vendor_id);
if (VIR_STRDUP(guest->vendor_id, oldguest->vendor_id) < 0)
goto cleanup;
}
/* Remove non-migratable features by default
* Note: this only works as long as no CPU model contains non-migratable
* features directly */

View File

@ -0,0 +1,20 @@
LC_ALL=C \
PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu \
-S \
-M pc \
-cpu 'core2duo,vendor=Libvirt QEMU,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,\
+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds' \
-m 214 \
-smp 6 \
-nographic \
-monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi \
-boot n \
-usb \
-net none \
-serial none \
-parallel none

View File

@ -0,0 +1,21 @@
<domain type='qemu'>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219100</memory>
<currentMemory unit='KiB'>219100</currentMemory>
<vcpu placement='static'>6</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='network'/>
</os>
<cpu mode='host-model'>
<model vendor_id="Libvirt QEMU"/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
</devices>
</domain>

View File

@ -1245,6 +1245,7 @@ mymain(void)
QEMU_CAPS_OBJECT_MEMORY_RAM);
DO_TEST_FAILURE("cpu-numa-memshared", QEMU_CAPS_SMP_TOPOLOGY);
DO_TEST("cpu-host-model", NONE);
DO_TEST("cpu-host-model-vendor", NONE);
skipLegacyCPUs = true;
DO_TEST("cpu-host-model-fallback", NONE);
DO_TEST_FAILURE("cpu-host-model-nofallback", NONE);