]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Fix variable sizing issues with 'bandwidth' argument of qemuBlockCommit
authorPeter Krempa <pkrempa@redhat.com>
Mon, 9 Jan 2023 13:35:52 +0000 (14:35 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Jan 2023 13:40:39 +0000 (14:40 +0100)
commitd9193ff92bd8f846fb3a616f647bd53430a444b5
tree261ed2e936394df7ca5238970c1da316c777d0c8
parent64366c005693a2fc389e3f61dbc68259ead2c260
qemu: Fix variable sizing issues with 'bandwidth' argument of qemuBlockCommit

The patch moving the code didn't faithfully represent the typecasting
of the 'bandwidth' variable needed to properly convert from the legacy
'unsigned long' argument which resulted in a build failure on 32 bit
systems:

../src/qemu/qemu_block.c: In function ‘qemuBlockCommit’:
../src/qemu/qemu_block.c:3249:23: error: comparison is always false due to limited range of data type [-Werror=type-limits]
 3249 |         if (bandwidth > LLONG_MAX >> 20) {
      |                       ^

Fix it by returning the check into qemuDomainBlockCommit as it's needed
only because of the legacy argument type in the old API and use
'unsigned long long' for qemuBlockCommit.

Fixes: f5a77198bf9
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_block.c
src/qemu/qemu_block.h
src/qemu/qemu_driver.c