diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index c461c4839d..631c755391 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -647,7 +647,8 @@ virCPUUpdateLive(virArch arch, if (!driver->updateLive) return 1; - if (cpu->mode == VIR_CPU_MODE_CUSTOM) { + if (cpu->mode == VIR_CPU_MODE_CUSTOM || + cpu->check == VIR_CPU_CHECK_FULL) { if (driver->updateLive(cpu, dataEnabled, dataDisabled) < 0) return -1; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 5a6b7bb1d8..7a8a2e3f3b 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3009,8 +3009,10 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, virCPUDataPtr dataEnabled, virCPUDataPtr dataDisabled) { + bool hostPassthrough = cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH; virCPUx86MapPtr map; virCPUx86ModelPtr model = NULL; + virCPUx86ModelPtr modelDisabled = NULL; virCPUx86Data enabled = VIR_CPU_X86_DATA_INIT; virCPUx86Data disabled = VIR_CPU_X86_DATA_INIT; virBuffer bufAdded = VIR_BUFFER_INITIALIZER; @@ -3026,6 +3028,10 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, if (!(model = x86ModelFromCPU(cpu, map, -1))) goto cleanup; + if (hostPassthrough && + !(modelDisabled = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_DISABLE))) + goto cleanup; + if (dataEnabled && x86DataCopy(&enabled, &dataEnabled->data.x86) < 0) goto cleanup; @@ -3040,7 +3046,8 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, if (x86DataIsSubset(&model->data, &feature->data)) expected = VIR_CPU_FEATURE_REQUIRE; - else + else if (!hostPassthrough || + x86DataIsSubset(&modelDisabled->data, &feature->data)) expected = VIR_CPU_FEATURE_DISABLE; if (expected == VIR_CPU_FEATURE_DISABLE && @@ -3101,6 +3108,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, cleanup: x86ModelFree(model); + x86ModelFree(modelDisabled); virCPUx86DataClear(&enabled); virCPUx86DataClear(&disabled); VIR_FREE(added);