From patchwork Tue Mar 2 02:06:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Wang X-Patchwork-Id: 12110885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FF11C433E0 for ; Tue, 2 Mar 2021 02:02:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82A9A6148E for ; Tue, 2 Mar 2021 02:02:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82A9A6148E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=zte.com.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGuMp-0002Ji-JI for qemu-devel@archiver.kernel.org; Mon, 01 Mar 2021 21:02:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGuLi-0001pq-1a for qemu-devel@nongnu.org; Mon, 01 Mar 2021 21:01:22 -0500 Received: from mx7.zte.com.cn ([202.103.147.169]:25499 helo=mxct.zte.com.cn) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGuLd-0000y4-V2 for qemu-devel@nongnu.org; Mon, 01 Mar 2021 21:01:21 -0500 Received: from mse-fl2.zte.com.cn (unknown [10.30.14.239]) by Forcepoint Email with ESMTPS id A08B9D4B2AD56D3E531F for ; Tue, 2 Mar 2021 10:01:06 +0800 (CST) Received: from kjyxapp01.zte.com.cn ([10.30.12.200]) by mse-fl2.zte.com.cn with SMTP id 12220w6Z085090 for ; Tue, 2 Mar 2021 10:00:58 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain (unknown [10.234.72.110]) by smtp (Zmail) with SMTP; Tue, 2 Mar 2021 10:00:58 +0800 X-Zmail-TransId: 3e88603d9c5901b-9ac6d From: Yi Wang To: qemu-devel@nongnu.org Subject: [PATCH] block: Change write_threshold to uint64 in BlockDeviceInfo Date: Tue, 2 Mar 2021 10:06:08 +0800 Message-Id: <20210302020608.13563-1-wang.yi59@zte.com.cn> X-Mailer: git-send-email 2.29.0-rc1 MIME-Version: 1.0 X-MAIL: mse-fl2.zte.com.cn 12220w6Z085090 Received-SPF: pass client-ip=202.103.147.169; envelope-from=wang.yi59@zte.com.cn; helo=mxct.zte.com.cn X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wang.yi59@zte.com.cn, renlei4 , wang.liang82@zte.com.cn, xue.zhihong@zte.com.cn Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: renlei4 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 Signed-off-by: Yi Wang --- 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: