Re: [PATCH] qemu: check if block I/O limits fit into long long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/24/2013 02:28 PM, Ján Tomko wrote:
> We can only pass values up to LLONG_MAX through JSON
> and QEMU checks if the int64_t number is not negative
> at startup since 1.5.0.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=974010
> ---
>  src/qemu/qemu_driver.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 3d9457f..b4b66aa 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -14099,6 +14099,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
>      for (i = 0; i < nparams; i++) {
>          virTypedParameterPtr param = &params[i];
>  
> +        if (param->value.ul > LLONG_MAX) {
> +            virReportError(VIR_ERR_OVERFLOW,
> +                           _("block I/O throttle limit value must"
> +                             " be less than %llu"), LLONG_MAX);
> +            goto endjob;
> +        }
> +
>          if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC)) {
>              info.total_bytes_sec = param->value.ul;
>              set_bytes = true;
> 

ACK,

Martin

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]