[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC PATCH 31/56] block: Make throttle byte rates and s
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [RFC PATCH 31/56] block: Make throttle byte rates and sizes unsigned in QAPI/QMP |
Date: |
Wed, 23 Aug 2017 15:42:11 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 07 Aug 2017 04:45:35 PM CEST, Markus Armbruster wrote:
> Sizes and byte rates should use QAPI type 'size' (uint64_t).
> BlockIOThrottle and BlockDeviceInfo members @bps, @bps_rd, @bps_wr,
> @bps_max, @bps_rd_max, @bps_wr_max, @iops_size are 'int' (int64_t).
> qmp_block_set_io_throttle() and bdrv_block_device_info() copy @bps,
> @bps_rd, @bps_wr to / from LeakyBucket member @avg (implicit
> conversion to / from double), @bps_max, @bps_rd_max, @bps_wr_max to /
> from LeakyBucket member @max (implicit conversion to / from double),
> and @iops_size to / from ThrottleConfig member op_size (implicit
> conversion to / from uint64_t).
>
> Change these BlockIOThrottle and BlockDeviceInfo members to 'size'.
>
> block_set_io_throttle now accepts sizes and rates between 2^63 and
> 2^64-1. It accepts negative values as before, because that's how the
> QObject input visitor works for backward compatibility.
>
> Doing the same for HMP's block_set_io_throttle deserves its own commit
> (the next one).
>
> query-block and query-named-block-nodes now report sizes and rates
> above 2^63-1 correctly instead of their (negative) two's complement.
>
> So does HMP's "info block".
>
> Signed-off-by: Markus Armbruster <address@hidden>
This is fine because all those parameters are limited to [0, 10^15], so
changing int64_t -> uint64_t is not a problem.
I have already sent a patch that changes the fields in the data
structure in throttle.h from double to uint64_t
Reviewed-by: Alberto Garcia <address@hidden>
Berto
- [Qemu-block] [RFC PATCH 33/56] block: Make block_resize size unsigned in QAPI/QMP, (continued)
- [Qemu-block] [RFC PATCH 33/56] block: Make block_resize size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 26/56] block: Make BlockMeasureInfo sizes unsigned in QAPI, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 32/56] hmp: Make block_set_io_throttle's arguments unsigned, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 27/56] block/dirty-bitmap: Clean up signed vs. unsigned dirty counts, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 31/56] block: Make throttle byte rates and sizes unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- Re: [Qemu-block] [RFC PATCH 31/56] block: Make throttle byte rates and sizes unsigned in QAPI/QMP,
Alberto Garcia <=
- [Qemu-block] [RFC PATCH 39/56] blockjob: Lift speed sign conversion out of block_job_create(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 45/56] blockjob: Lift speed sign conversion out of commit_start() etc., Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 36/56] blockjob: Drop unused parameter @errp of method set_speed(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 43/56] blockjob: Lift speed sign conversion out of mirror_start(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 44/56] blockjob: Lift speed sign conversion out of blockdev_mirror_common(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 49/56] block: Make ImageCheck file offset unsigned in QAPI, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 52/56] block/nfs: Reject negative readahead-size, page-cache-size, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 30/56] block: Make write thresholds unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 40/56] blockjob: Lift speed sign conversion out of backup_job_create(), Markus Armbruster, 2017/08/07