]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix hyperv spinlock retries count type mismatch
authorFriedrich Oslage <friedrich@oslage.de>
Wed, 22 Oct 2025 09:07:15 +0000 (11:07 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Oct 2025 13:17:44 +0000 (15:17 +0200)
Use unsigned int for sprintf and update tests to ensure it can hold INT_MAX+1.

Signed-off-by: Friedrich Oslage <friedrich@oslage.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
tests/qemuxmlconfdata/hyperv.x86_64-latest.args
tests/qemuxmlconfdata/hyperv.x86_64-latest.xml
tests/qemuxmlconfdata/hyperv.xml

index 473759448770c1f8f8518f5f285d6d1b09963e7b..7c951fdc327204e8f6203c8c9cd0414099dd2441 100644 (file)
@@ -28633,7 +28633,7 @@ virDomainFeaturesHyperVDefFormat(virBuffer *buf,
         case VIR_DOMAIN_HYPERV_SPINLOCKS:
             if (def->hyperv.features[j] == VIR_TRISTATE_SWITCH_ON) {
                 virBufferAsprintf(&hypervAttrBuf,
-                                  " retries='%d'", def->hyperv.spinlocks);
+                                  " retries='%u'", def->hyperv.spinlocks);
             }
             break;
 
index 30d63bae6b76b5a9e37eb4a3e89e710af2c11d35..ea4b77de74771a37314d181206292cbb50d2b9dc 100644 (file)
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
 -machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \
 -accel tcg \
--cpu 'qemu64,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x2fff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-reset=on,hv-vendor-id=KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-tlbflush-direct=on,hv-tlbflush-ext=on,hv-ipi=on,hv-evmcs=on,hv-avic=on,hv-emsr-bitmap=on,hv-xmm-input=on' \
+-cpu 'qemu64,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x80000000,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-reset=on,hv-vendor-id=KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-tlbflush-direct=on,hv-tlbflush-ext=on,hv-ipi=on,hv-evmcs=on,hv-avic=on,hv-emsr-bitmap=on,hv-xmm-input=on' \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
index ee412164edc0ad9ea74ec28cc8178534fb9c0723..fdcab661a6124d64891da613b45edc53ac26ea93 100644 (file)
@@ -13,7 +13,7 @@
     <hyperv mode='custom'>
       <relaxed state='on'/>
       <vapic state='on'/>
-      <spinlocks state='on' retries='12287'/>
+      <spinlocks state='on' retries='2147483648'/>
       <vpindex state='on'/>
       <runtime state='on'/>
       <synic state='on'/>
index 44aec004a858b0cb3365fe184f884a0fdaa60d2b..9a47dd0ec817752e79b32f44c2f61d25c845b941 100644 (file)
@@ -13,7 +13,7 @@
     <hyperv>
       <relaxed state='on'/>
       <vapic state='on'/>
-      <spinlocks state='on' retries='12287'/>
+      <spinlocks state='on' retries='2147483648'/>
       <vpindex state='on'/>
       <runtime state='on'/>
       <synic state='on'/>