@samitouri / QOSamiQemu / commits / c4cf32fc63

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 <anisinha@redhat.com> Link: https://lore.kernel.org/r/20260225035000.385950-27-anisinha@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Ani Sinha committed Feb 25, 2026 at 09:19 UTC c4cf32fc63f1879232e4a692e5208b705cec49f0
1 file changed +1 -1
target/i386/kvm/kvm.c
+1 -1
@@ -1761,7 +1761,7 @@ static int hyperv_init_vcpu(X86CPU *cpu)
1761 return ret;
1762 }
1763
1764 - if (!cpu->hyperv_synic_kvm_only) {
1764 + if (!cpu->hyperv_synic_kvm_only && !hyperv_is_synic_enabled()) {
1765 ret = hyperv_x86_synic_add(cpu);
1766 if (ret < 0) {
1767 error_report("failed to create HyperV SynIC: %s",