From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1E12-0008Ef-2I for qemu-devel@nongnu.org; Wed, 07 Sep 2011 05:01:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1E10-0004PW-Qs for qemu-devel@nongnu.org; Wed, 07 Sep 2011 05:01:52 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:58408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1E10-0004H2-KS for qemu-devel@nongnu.org; Wed, 07 Sep 2011 05:01:50 -0400 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e33.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p878reW5000725 for ; Wed, 7 Sep 2011 02:53:40 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8790JVB146360 for ; Wed, 7 Sep 2011 03:00:19 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8730ISb005046 for ; Tue, 6 Sep 2011 21:00:18 -0600 From: Zhi Yong Wu Date: Wed, 7 Sep 2011 16:59:55 +0800 Message-Id: <1315385995-23283-1-git-send-email-wuzhy@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v1] domain_conf: add the support for disk I/O throttle setting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: zwu.kernel@gmail.com, Zhi Yong Wu , stefanha@linux.vnet.ibm.com, agl@us.ibm.com The first patch is only used to see if it is suitable for exteeding blkiotune to implement disk I/O throttling. As you have known, when blkiotune is issued without options, it will display current tuning parameters; If we exceed it, without options, what should it display? both info will? or should one new option be added to separately display them? Signed-off-by: Zhi Yong Wu --- src/conf/domain_conf.c | 18 ++++++++++++++++++ src/conf/domain_conf.h | 11 +++++++++++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index cce9955..7dd350a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9065,6 +9065,24 @@ virDomainDiskDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " \n", def->dst, bus); + /*disk I/O throttling*/ + if (def->blkio.blkiothrottle) { + virBufferAsprintf(&buf, " \n"); + virBufferAsprintf(&buf, " %llu\n", + def->blkiothrottle.bps); + virBufferAsprintf(&buf, " %llu\n", + def->blkiothrottle.bps_rd); + virBufferAsprintf(&buf, " %llu\n", + def->blkiothrottle.bps_wr); + virBufferAsprintf(&buf, " %llu\n", + def->blkiothrottle.iops); + virBufferAsprintf(&buf, " %llu\n", + def->blkiothrottle.iops_rd); + virBufferAsprintf(&buf, " %llu\n", + def->blkiothrottle.iops_wr); + virBufferAsprintf(&buf, " \n"); + } + if (def->bootIndex) virBufferAsprintf(buf, " \n", def->bootIndex); if (def->readonly) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e218a30..5902377 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -258,6 +258,17 @@ struct _virDomainDiskDef { virDomainDiskHostDefPtr hosts; char *driverName; char *driverType; + + /*disk I/O throttling*/ + struct { + unsigned long long bps; + unsigned long long bps_rd; + unsigned long long bps_wr; + unsigned long long iops; + unsigned long long iops_rd; + unsigned long long iops_wr; + } blkiothrottle; + char *serial; int cachemode; int error_policy; -- 1.7.6