]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
kvm/hyperv: add synic feature to CPU only if its not enabled
authorAni Sinha <anisinha@redhat.com>
Wed, 25 Feb 2026 03:49:31 +0000 (09:19 +0530)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 27 Feb 2026 13:48:03 +0000 (14:48 +0100)
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>
target/i386/kvm/kvm.c

index 9d7a9ffceb88e528ee05fa99b47d1de12d972ab8..7cfbc7832deb67f7504f0ebd54bd3f8ddd3f75d8 100644 (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",