提交 d3c87884 编写于 作者: J Ján Tomko

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
上级 7a99eb91
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册