Skip to contentSkip to conversation

block: Change write_threshold to uint64 in BlockDeviceInfo

PATCH New Yi Wang 1 participant 1 message Mar 2, 2021

lore
Share & tools
lore

Yi Wang

author
#0 lore raw

PATCH 1/1 block: Change write_threshold to uint64 in BlockDeviceInfo

From: renlei4 <[email protected]>

write_threshold is saved as uint64, but BlockDeviceInfo use int to describe it.

normally it works well if threshold less than max int:

 # virsh domblkthreshold v6_163 sda 9223372036854775807
 # virsh qemu-monitor-command v6_163  '{ "execute": "query-named-block-nodes" }' |grep threshold
            "write_threshold": 9223372036854775807,

overflow happened if threshold greater than max int:

 # virsh domblkthreshold v6_163 sda 9223372036854775811
 # virsh qemu-monitor-command v6_163   '{ "execute": "query-named-block-nodes" }' |grep threshold
            "write_threshold": -9223372036854775805,
Fixes e2462113b200 "block: add event when disk usage exceeds threshold"
---
 qapi/block-core.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qapi/block-core.json +1 -1
index 9f555d5..00b8729 100644
@@ -409,7 +409,7 @@
             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
             '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
-            'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
+            'write_threshold': 'uint64', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
 
 ##
 # @BlockDeviceIoStatus:
Signature · 1 line
1.8.3.1