mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-10 21:51:31 +00:00
qemu: check if block I/O limits fit into long long
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 (cherry picked from commit d3c87884927e6b745d0a5680e6d94a40c4f484f7)
This commit is contained in:
parent
22d9d9a28f
commit
a717d7ba0f
@ -13624,6 +13624,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
|||||||
for (i = 0; i < nparams; i++) {
|
for (i = 0; i < nparams; i++) {
|
||||||
virTypedParameterPtr param = ¶ms[i];
|
virTypedParameterPtr param = ¶ms[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)) {
|
if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC)) {
|
||||||
info.total_bytes_sec = param->value.ul;
|
info.total_bytes_sec = param->value.ul;
|
||||||
set_bytes = true;
|
set_bytes = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user