From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dejJ7-0007R4-Oq for qemu-devel@nongnu.org; Mon, 07 Aug 2017 10:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dejIs-0003x0-K4 for qemu-devel@nongnu.org; Mon, 07 Aug 2017 10:47:01 -0400 From: Markus Armbruster Date: Mon, 7 Aug 2017 16:45:36 +0200 Message-Id: <1502117160-24655-33-git-send-email-armbru@redhat.com> In-Reply-To: <1502117160-24655-1-git-send-email-armbru@redhat.com> References: <1502117160-24655-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [RFC PATCH 32/56] hmp: Make block_set_io_throttle's arguments unsigned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, kwolf@redhat.com, mreitz@redhat.com, jcody@redhat.com, famz@redhat.com, jsnow@redhat.com, pbonzini@redhat.com, marcandre.lureau@redhat.com, dgilbert@redhat.com, quintela@redhat.com, berrange@redhat.com, qemu-block@nongnu.org The previous commit made them unsigned in QMP. Switch HMP's args_type from 'l' to 'o'. Loses support for expressions (QEMU pocket calculator), gains support for unit suffixes. Negative values are no longer accepted and interpreted modulo 2^64. Instead, values between 2^63 and 2^64-1 are now accepted. Signed-off-by: Markus Armbruster --- hmp-commands.hx | 2 +- hmp.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 46ce79c..bc3c066 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1668,7 +1668,7 @@ ETEXI { .name = "block_set_io_throttle", - .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l", + .args_type = "device:B,bps:o,bps_rd:o,bps_wr:o,iops:l,iops_rd:l,iops_wr:l", .params = "device bps bps_rd bps_wr iops iops_rd iops_wr", .help = "change I/O throttle limits for a block drive", .cmd = hmp_block_set_io_throttle, diff --git a/hmp.c b/hmp.c index 3253674..599e816 100644 --- a/hmp.c +++ b/hmp.c @@ -1764,9 +1764,9 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict) BlockIOThrottle throttle = { .has_device = true, .device = (char *) qdict_get_str(qdict, "device"), - .bps = qdict_get_int(qdict, "bps"), - .bps_rd = qdict_get_int(qdict, "bps_rd"), - .bps_wr = qdict_get_int(qdict, "bps_wr"), + .bps = qdict_get_uint(qdict, "bps"), + .bps_rd = qdict_get_uint(qdict, "bps_rd"), + .bps_wr = qdict_get_uint(qdict, "bps_wr"), .iops = qdict_get_int(qdict, "iops"), .iops_rd = qdict_get_int(qdict, "iops_rd"), .iops_wr = qdict_get_int(qdict, "iops_wr"), -- 2.7.5