Re: [Qemu-devel] [PATCH 25/27] block: Fail bdrv_truncate() with negative size

2018-02-12 Thread Max Reitz
On 2018-02-08 20:23, Kevin Wolf wrote: > Most callers have their own checks, but something like this should also > be checked centrally. As it happens, x-blockdev-create can pass negative > image sizes to format drivers (because there is no QAPI type that would > reject negative numbers) and

[Qemu-devel] [PATCH 25/27] block: Fail bdrv_truncate() with negative size

2018-02-08 Thread Kevin Wolf
Most callers have their own checks, but something like this should also be checked centrally. As it happens, x-blockdev-create can pass negative image sizes to format drivers (because there is no QAPI type that would reject negative numbers) and triggers the check added by this patch.