qemu-patch-raspberry4/include
Alberto Garcia 67335a4558 throttle: Make burst_length 64bit and add range checks
LeakyBucket.burst_length is defined as an unsigned integer but the
code never checks for overflows and it only makes sure that the value
is not 0.

In practice this means that the user can set something like
throttling.iops-total-max-length=4294967300 despite being larger than
UINT_MAX and the final value after casting to unsigned int will be 4.

This patch changes the data type to uint64_t. This does not increase
the storage size of LeakyBucket, and allows us to assign the value
directly from qemu_opt_get_number() or BlockIOThrottle and then do the
checks directly in throttle_is_valid().

The value of burst_length does not have a specific upper limit,
but since the bucket size is defined by max * burst_length we have
to prevent overflows. Instead of going for UINT64_MAX or something
similar this patch reuses THROTTLE_VALUE_MAX, which allows I/O bursts
of 1 GiB/s for 10 days in a row.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 1b2e3049803f71cafb2e1fa1be4fb47147a0d398.1503580370.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-08-29 16:54:45 +01:00
..
block block: Allow reopen rw without BDRV_O_ALLOW_RDWR 2017-08-08 15:19:16 +02:00
chardev char: don't exit on hmp 'chardev-add help' 2017-08-01 17:27:33 +02:00
crypto crypto: hmac: add hmac driver framework 2017-07-19 10:11:05 +01:00
disas Fix Thumb-1 BE32 execution and disassembly. 2017-02-07 18:29:59 +00:00
exec cpu_physical_memory_sync_dirty_bitmap: Fix alignment check 2017-08-01 17:27:33 +02:00
fpu configure: Drop ancient Solaris 9 and earlier support 2017-07-21 15:04:05 +01:00
hw hw/ppc/spapr: Fix segfault when instantiating a 'pc-dimm' without 'memdev' 2017-08-22 21:26:46 +10:00
io trivial patches for 2017-05-10 2017-05-10 12:31:19 -04:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration migration: remove check against colo support 2017-07-18 17:36:24 +02:00
monitor block: rip out all traces of password prompting 2017-07-11 17:44:56 +02:00
net net/net.c: Add vnet_hdr support in SocketReadState 2017-07-17 20:02:11 +08:00
qapi docs: fix broken paths to docs/devel/qapi-code-gen.txt 2017-07-31 13:12:41 +03:00
qemu throttle: Make burst_length 64bit and add range checks 2017-08-29 16:54:45 +01:00
qom Revert "cpu: add APIs to allocate/free CPU environment" 2017-08-09 04:22:13 +03:00
standard-headers linux-headers: update to 4.13-rc0 2017-07-14 12:29:10 +02:00
sysemu block-backend: Allow more "can inactivate" cases 2017-08-23 10:21:55 -05:00
ui ui: move qemu_input_linux_to_qcode() 2017-07-27 14:23:09 +02:00
elf.h s390x/arch_dump: also dump guarded storage control block 2017-07-14 12:29:49 +02:00
glib-compat.h qga: Add 'guest-get-users' command 2017-04-26 23:57:45 -05:00
qemu-common.h maint: Include bug-reporting info in --help output 2017-08-08 17:28:53 +02:00
qemu-io.h hmp: Request permissions in qemu-io 2017-02-28 20:47:50 +01:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00