[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/22] block: refuse negative iops and bps values
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 09/22] block: refuse negative iops and bps values |
Date: |
Fri, 22 Feb 2013 22:23:38 +0100 |
From: Stefan Hajnoczi <address@hidden>
Negative I/O throttling iops and bps values do not make sense so reject
them with an error message.
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
blockdev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 9b03513..ba3759c 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -274,6 +274,16 @@ static bool do_check_io_limits(BlockIOLimit *io_limits,
Error **errp)
return false;
}
+ if (io_limits->bps[BLOCK_IO_LIMIT_TOTAL] < 0 ||
+ io_limits->bps[BLOCK_IO_LIMIT_WRITE] < 0 ||
+ io_limits->bps[BLOCK_IO_LIMIT_READ] < 0 ||
+ io_limits->iops[BLOCK_IO_LIMIT_TOTAL] < 0 ||
+ io_limits->iops[BLOCK_IO_LIMIT_WRITE] < 0 ||
+ io_limits->iops[BLOCK_IO_LIMIT_READ] < 0) {
+ error_setg(errp, "bps and iops values must be 0 or greater");
+ return false;
+ }
+
return true;
}
--
1.8.1.2
- [Qemu-devel] [PULL 00/22] Block patches, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 02/22] qemu-img: add json output option to the check command, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 01/22] qemu-img: find the image end offset during check, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 03/22] qcow2: introduce check_refcounts_l1/l2() flags, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 04/22] qcow2: record fragmentation statistics during check, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 10/22] block: Add synchronous wrapper for bdrv_co_is_allocated_above, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 07/22] qcow2: support compressed clusters in BlockFragInfo, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 09/22] block: refuse negative iops and bps values,
Kevin Wolf <=
- [Qemu-devel] [PATCH 08/22] block: use Error in do_check_io_limits(), Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 06/22] qemu-img: add compressed clusters to BlockFragInfo, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 05/22] qemu-img: fix missing space in qemu-img check output, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 12/22] qemu-img: Add compare subcommand, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 11/22] qemu-img: Add "Quiet mode" option, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 15/22] coroutine: move pooling to common code, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 13/22] qemu-iotests: Add qemu-img compare test, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 16/22] coroutine: trim down nesting level in perf_nesting test, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 17/22] block: complete all IOs before .bdrv_truncate, Kevin Wolf, 2013/02/22
- [Qemu-devel] [PATCH 19/22] blockdev: add discard suboption to -drive, Kevin Wolf, 2013/02/22