qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yi Wang <wang.yi59@zte.com.cn>
To: qemu-devel@nongnu.org
Cc: wang.yi59@zte.com.cn, renlei4 <ren.lei4@zte.com.cn>,
	wang.liang82@zte.com.cn, xue.zhihong@zte.com.cn
Subject: [PATCH] block: Change write_threshold to uint64 in BlockDeviceInfo
Date: Tue,  2 Mar 2021 10:06:08 +0800	[thread overview]
Message-ID: <20210302020608.13563-1-wang.yi59@zte.com.cn> (raw)


[-- 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 --]

                 reply	other threads:[~2021-03-02  2:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210302020608.13563-1-wang.yi59@zte.com.cn \
    --to=wang.yi59@zte.com.cn \
    --cc=qemu-devel@nongnu.org \
    --cc=ren.lei4@zte.com.cn \
    --cc=wang.liang82@zte.com.cn \
    --cc=xue.zhihong@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).