kvm/hyperv: add synic feature to CPU only if its not enabled

We need to make sure that synic CPU feature is not already enabled. If it is,
trying to enable it again will result in the following assertion:

Unexpected error in object_property_try_add() at ../qom/object.c:1268:
qemu-system-x86_64: attempt to add duplicate property 'synic' to object (type 'host-x86_64-cpu')

So enable synic only if its not enabled already.

Signed-off-by: Ani Sinha <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
Ani Sinha authored and Paolo Bonzini committed 2026-02-27 14:48:03 +01:00
1 parent 06fd6ae044
commit c4cf32fc63
1 file changed
+1 -1
+1 -1
View File
@@ -1761,7 +1761,7 @@ static int hyperv_init_vcpu(X86CPU *cpu)
return ret;
}
if (!cpu->hyperv_synic_kvm_only) {
if (!cpu->hyperv_synic_kvm_only && !hyperv_is_synic_enabled()) {
ret = hyperv_x86_synic_add(cpu);
if (ret < 0) {
error_report("failed to create HyperV SynIC: %s",