Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-19 Thread Alberto Garcia
On Mon 18 Jan 2016 02:09:22 AM CET, Fam Zheng wrote: >> > -error_setg(errp, "bps/iops/maxs values must be 0 or greater"); >> > +error_setg(errp, "bps/iops/max values must be within [0, %" PRId64 >> > + ")", (int64_t)THROTTLE_VALUE_MAX); >>

Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-17 Thread Fam Zheng
On Fri, 01/15 15:28, Kevin Wolf wrote: > Am 15.01.2016 um 03:09 hat Fam Zheng geschrieben: > > The implicit casting from unsigned int to double changes negative values > > into large positive numbers and accepts them. We should instead print > > an error. > > > > Check the number range so this

Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-15 Thread Kevin Wolf
Am 15.01.2016 um 03:09 hat Fam Zheng geschrieben: > The implicit casting from unsigned int to double changes negative values > into large positive numbers and accepts them. We should instead print > an error. > > Check the number range so this case is caught and reported. > > Signed-off-by: Fam

Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-15 Thread Markus Armbruster
Fam Zheng writes: > The implicit casting from unsigned int to double changes negative values > into large positive numbers and accepts them. We should instead print > an error. --verbose: * extract_common_blockdev_options() uses qemu_opt_get_number() to parse the number to

[Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-14 Thread Fam Zheng
The implicit casting from unsigned int to double changes negative values into large positive numbers and accepts them. We should instead print an error. Check the number range so this case is caught and reported. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz