diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 03f9a6c092..78e0cabc3e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1400,22 +1400,22 @@ 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 || - disk->blkdeviotune.total_bytes_sec_max > LLONG_MAX || - disk->blkdeviotune.read_bytes_sec_max > LLONG_MAX || - disk->blkdeviotune.write_bytes_sec_max > LLONG_MAX || - disk->blkdeviotune.total_iops_sec_max > LLONG_MAX || - disk->blkdeviotune.read_iops_sec_max > LLONG_MAX || - disk->blkdeviotune.write_iops_sec_max > LLONG_MAX || - disk->blkdeviotune.size_iops_sec > LLONG_MAX) { - virReportError(VIR_ERR_OVERFLOW, + if (disk->blkdeviotune.total_bytes_sec > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.read_bytes_sec > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.write_bytes_sec > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.total_iops_sec > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.read_iops_sec > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.write_iops_sec > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.total_bytes_sec_max > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.read_bytes_sec_max > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.write_bytes_sec_max > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.total_iops_sec_max > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.read_iops_sec_max > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.write_iops_sec_max > QEMU_BLOCK_IOTUNE_MAX || + disk->blkdeviotune.size_iops_sec > QEMU_BLOCK_IOTUNE_MAX) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("block I/O throttle limit must " - "be less than %llu using QEMU"), LLONG_MAX); + "be less than %llu using QEMU"), QEMU_BLOCK_IOTUNE_MAX); goto error; } diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 7c13d459f8..1d027a5120 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -40,6 +40,8 @@ # define QEMU_DRIVE_HOST_PREFIX "drive-" # define QEMU_FSDEV_HOST_PREFIX "fsdev-" +# define QEMU_BLOCK_IOTUNE_MAX 1000000000000000LL + VIR_ENUM_DECL(qemuVideo) typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0434438b28..1290f3f5c1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17506,10 +17506,10 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, for (i = 0; i < nparams; i++) { virTypedParameterPtr param = ¶ms[i]; - if (param->value.ul > LLONG_MAX) { - virReportError(VIR_ERR_OVERFLOW, + if (param->value.ul > QEMU_BLOCK_IOTUNE_MAX) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("block I/O throttle limit value must" - " be less than %llu"), LLONG_MAX); + " be less than %llu"), QEMU_BLOCK_IOTUNE_MAX); goto endjob; }