qemu: introduce period/quota tuning for emulator

This patch introduces support of setting emulator's period and
quota to limit cpu bandwidth when the vm starts.  Also updates
XML Schema for new entries and docs.
This commit is contained in:
Hu Tao
2012-08-21 17:18:42 +08:00
committed by Daniel Veillard
parent 1d4395eb47
commit b65dafa812
5 changed files with 69 additions and 3 deletions

View File

@@ -388,6 +388,8 @@
<shares>2048</shares>
<period>1000000</period>
<quota>-1</quota>
<emulator_period>1000000</period>
<emulator_quota>-1</quota>
</cputune>
...
</domain>
@@ -451,6 +453,28 @@
<span class="since">Only QEMU driver support since 0.9.4, LXC since
0.9.10</span>
</dd>
<dt><code>emulator_period</code></dt>
<dd>
The optional <code>emulator_period</code> element specifies the enforcement
interval(unit: microseconds). Within <code>emulator_period</code>, emulator
threads(those excluding vcpus) of the domain will not be allowed to consume
more than <code>emulator_quota</code> worth of runtime. The value should be
in range [1000, 1000000]. A period with value 0 means no value.
<span class="since">Only QEMU driver support since 0.10.0</span>
</dd>
<dt><code>emulator_quota</code></dt>
<dd>
The optional <code>emulator_quota</code> element specifies the maximum
allowed bandwidth(unit: microseconds) for domain's emulator threads(those
excluding vcpus). A domain with <code>emulator_quota</code> as any negative
value indicates that the domain has infinite bandwidth for emulator threads
(those excluding vcpus), which means that it is not bandwidth controlled.
The value should be in range [1000, 18446744073709551] or less than 0. A
quota with value 0 means no value.
<span class="since">Only QEMU driver support since 0.10.0</span>
</dd>
</dl>