qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Change write_threshold to uint64 in BlockDeviceInfo
@ 2021-03-02  2:06 Yi Wang
  0 siblings, 0 replies; only message in thread
From: Yi Wang @ 2021-03-02  2:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: wang.yi59, renlei4, wang.liang82, xue.zhihong


[-- Attachment #1.1.1: Type: text/plain, Size: 1511 bytes --]

From: renlei4 <ren.lei4@zte.com.cn>

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"

Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 qapi/block-core.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 9f555d5..00b8729 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -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:
-- 
1.8.3.1

[-- Attachment #1.1.2: Type: text/html , Size: 3076 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-02  2:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-02  2:06 [PATCH] block: Change write_threshold to uint64 in BlockDeviceInfo Yi Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).