diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 35ff8f2f03c40ec4209fed2ec2e440a0783bc99e..9241f57af6b5d6e92dc88000ea8ef1c8aaab4630 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3620,6 +3620,18 @@ qemuBuildDriveStr(virConnectPtr conn, goto error; } + if (disk->blkdeviotune.total_bytes_sec > LLONG_MAX || + disk->blkdeviotune.read_bytes_sec > LLONG_MAX || + disk->blkdeviotune.write_bytes_sec > LLONG_MAX || + disk->blkdeviotune.total_iops_sec > LLONG_MAX || + disk->blkdeviotune.read_iops_sec > LLONG_MAX || + disk->blkdeviotune.write_iops_sec > LLONG_MAX) { + virReportError(VIR_ERR_OVERFLOW, + _("block I/O throttle limit must " + "be less than %llu using QEMU"), LLONG_MAX); + goto error; + } + if (disk->blkdeviotune.total_bytes_sec) { virBufferAsprintf(&opt, ",bps=%llu", disk->blkdeviotune.total_bytes_sec);